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; }
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>(); }
public BugNetTool(NetModel netModel) : this() { build(netModel); }
public ICustomObject recreate(Dictionary <string, string> additionalSaveData, object replacement) { NetModel netModel = AllNets.Find(n => n.FullId == additionalSaveData["id"]); return(new BugNetTool(netModel)); }