Beispiel #1
0
        private void build(NetModel netModel)
        {
            this.netModel = netModel;
            if (data == null)
            {
                data = CustomObjectData.collection.ContainsKey(netModel.FullId) ? CustomObjectData.collection[netModel.FullId] : new CustomObjectData(netModel.FullId, netModel.QuickItemDataString, netModel.getTexture(), Color.White, netModel.TileIndex, true, typeof(BugNetTool));
            }
            if (sObject == null)
            {
                sObject = new SObject(data.sdvId, 1);
            }
            if (texture == null)
            {
                texture = netModel.getTexture();
            }

            Name        = netModel.Name;
            DisplayName = Name;
            description = netModel.Description;

            InitialParentTileIndex = 504;
            CurrentParentTileIndex = 504;
            IndexOfMenuItemView    = 5;
            UpgradeLevel           = 1;

            InstantUse = false;
            inUse      = false;
        }
Beispiel #2
0
        public void rebuild(Dictionary <string, string> additionalSaveData, object replacement)
        {
            Log.info($"rebuilding : {additionalSaveData["id"]}");
            NetModel netModel = AllNets.Find(n => n.FullId == additionalSaveData["id"]);

            build(netModel);
            sObject.TileLocation = additionalSaveData["tileLocation"].Split(',').toList(i => i.toInt()).toVector <Vector2>();
        }
Beispiel #3
0
 public BugNetTool(NetModel netModel)
     : this()
 {
     build(netModel);
 }
Beispiel #4
0
        public ICustomObject recreate(Dictionary <string, string> additionalSaveData, object replacement)
        {
            NetModel netModel = AllNets.Find(n => n.FullId == additionalSaveData["id"]);

            return(new BugNetTool(netModel));
        }