Пример #1
0
        public static Keep CreateNew(ILevelManager level, IBuilding building, KeepType myType)
        {
            Keep newKeep = null;

            try {
                newKeep = new Keep(level, building, myType);
                newKeep.CreatePathfindingNodes();
                StaticRangeTarget.CreateNew(newKeep, level, building.Center);
                newKeep.clicker          = Clicker.CreateNew(newKeep, level);
                newKeep.clicker.Clicked += newKeep.KeepClicked;
                newKeep.healthBar        =
                    new HealthBarControl(level, building, 100, new Vector3(0, 3, 0), new Vector2(2f, 0.2f), false);
                newKeep.window = building.Player == level.HumanPlayer ? new KeepWindow(newKeep) : null;
                return(newKeep);
            }
            catch (Exception e) {
                newKeep?.Dispose();
                throw;
            }
        }
Пример #2
0
 public override BuildingInstancePlugin GetInstanceForLoading(ILevelManager level, IBuilding building)
 {
     return(Keep.CreateForLoading(level, building, this));
 }
Пример #3
0
 public override BuildingInstancePlugin CreateNewInstance(ILevelManager level, IBuilding building)
 {
     return(Keep.CreateNew(level, building, this));
 }
Пример #4
0
 public KeepWindow(Keep keep)
 {
     this.keep = keep;
     instance  = new KeepWindowInstance(this);
 }