protected Resource(string name, int durability, ComponentHarvestable harvestBehavior, bool walkable) : base(true) { this.AddComponent(new ComponentHasTexture(false)); this.AddComponent(harvestBehavior); this.DisplayName = name; this.Durability = durability; this.Walkable = walkable; this.MaxDurability = new Attribute32(this.Durability); }
public void GetComponent_StateUnderTest_ExpectedBehavior() { // Arrange HasComponents unitUnderTest = this.CreateHasComponents(); // Act ComponentSelectable result = unitUnderTest.GetComponent <ComponentSelectable>(); ComponentHarvestable result2 = unitUnderTest.GetComponent <ComponentHarvestable>(); // Assert Assert.IsNotNull(result); Assert.IsNotNull(result2); }
public Corn(string name, int durability, ComponentHarvestable harvestBehavior) : base(Name, durability, harvestBehavior, true) { // Determine corn yield Random random = new Random(); int cornYield = random.Next(MinimumCornYield, MaximumCornYield); this.Durability = DefaultCornDurability; // initialize harvesting list List <Base.Item> list = new List <Base.Item> { new CornEar(cornYield) }; this.AddComponent(new DropWhenCompletelyHarvested(list, SoundsTable.TreeFall, SoundsTable.TreeFall)); ComponentHasTexture textureComponent = this.GetExactComponent <ComponentHasTexture>(); textureComponent.Visuals.Add(CornSeedling); textureComponent.Visuals.Add(CornGrowth1); textureComponent.Visuals.Add(CornGrowth2); textureComponent.Visuals.Add(CornFullGrowth); }
/// <summary> /// The constructor for <see cref="Vegetation"/>. /// </summary> /// <param name="name">The name of this vegetation.</param> protected Vegetation(string name, int durability, ComponentHarvestable harvestBehavior, bool walkable) : base(name, durability, harvestBehavior, walkable) { }
protected TreeBase(string name, int durability, ComponentHarvestable harvestBehavior) : base(name, durability, harvestBehavior, true) { }
protected RockBase(string name, int durability, ComponentHarvestable harvestBehavior) : base(name, durability, harvestBehavior, false) { }