// This is what i would do:
using System;
using System.Collections.Generic;
namespace ApplesAndFruitsDesign
{
class Program
{
static void Main(string[] args)
{
List<string> colors = new List<string>() { "red" };
Fruit apple = new Fruit(colors, true, true, 3, "Apple");
Console.Write("MyFruit Details: Fruit.Name = {0}", apple.FruitName);
Console.ReadKey();
}
}
public class Fruit
{
public List<string> Colors { get; set; }
public bool CanGrow { get; set; }
public bool HasSeeds { get; set; }
public int SeedsCount { get; set; }
public string FruitName { get; set; }
public Fruit(List<string> colors, bool canGrow, bool hasSeeds, int seedsCount, string name)
{
this.Colors = colors;
this.CanGrow = canGrow;
this.HasSeeds = hasSeeds;
this.SeedsCount = seedsCount;
this.FruitName = name;
}
public List<Fruit> MakeFruitFromSeeds()
{
List<Fruit> fruits = new List<Fruit>();
for (int i = 0; i < this.SeedsCount; i++)
{
Fruit fruit = new Fruit(this.Colors, this.CanGrow, this.HasSeeds, this.SeedsCount, this.FruitName);
fruits.Add(fruit);
}
return fruits;
}
}
}