// Use this for initialization void Start() { if (tree) { treeScript = GetComponent <TreeResource>(); } else if (strut) { strutScript = GetComponent <Strut>(); } else if (channelBuilder) { channelBuilderScript = GetComponent <ChannelBuilder>(); } else if (channel) { channelScript = GetComponent <Channel>(); } else if (windmill) { Debug.Log("Get the windmill"); } else if (waterWheel) { Debug.Log("Get the waterWheel"); } }
public TreeResourceItem(TreeResource resource, int amount) { Stackable = true; Amount = amount; m_Resource = resource; ResetValues(); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); if (version == 0) { m_ResourceType = (TreeResourceType)reader.ReadInt(); } m_Resource = (TreeResource)reader.ReadInt(); ResetValues(); }
public void CreateTree(double lat, double lng) { Tree expectedTree = new Tree(lat, lng, string.Empty); mockTreeService.Setup(p => p.CreateTree(expectedTree)).Returns(1); ILogger <TreeController> logger = mockLogger.Object; logger = Mock.Of <ILogger <TreeController> >(); var treeResource = new TreeResource { latitude = lat, longitude = lng }; TreeController tree = new TreeController(logger, mockTreeService.Object); ActionResult <Tree> response = tree.CreateTree(treeResource); Tree a = (Tree)(response.Result as CreatedAtActionResult).Value; Assert.Equal(expectedTree.Location.Latitude, a.Location.Latitude); Assert.Equal(expectedTree.Location.Longitude, a.Location.Longitude); }
public TreeResourceItem(TreeResource resource) : this(resource, 1) { }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); if (version == 0) m_ResourceType = (TreeResourceType)reader.ReadInt(); m_Resource = (TreeResource)reader.ReadInt(); ResetValues(); }