コード例 #1
0
 // 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");
     }
 }
コード例 #2
0
 public TreeResourceItem(TreeResource resource, int amount)
 {
     Stackable  = true;
     Amount     = amount;
     m_Resource = resource;
     ResetValues();
 }
コード例 #3
0
        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();
        }
コード例 #4
0
        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);
        }
コード例 #5
0
 public TreeResourceItem(TreeResource resource)
     : this(resource, 1)
 {
 }
コード例 #6
0
ファイル: TreeResources.cs プロジェクト: greeduomacro/RuneUO
        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();
        }
コード例 #7
0
ファイル: TreeResources.cs プロジェクト: greeduomacro/RuneUO
 public TreeResourceItem(TreeResource resource, int amount)
 {
     Stackable = true;
     Amount = amount;
     m_Resource = resource;
     ResetValues();
 }
コード例 #8
0
ファイル: TreeResources.cs プロジェクト: greeduomacro/RuneUO
 public TreeResourceItem(TreeResource resource)
     : this(resource, 1)
 {
 }