예제 #1
0
파일: Keep.cs 프로젝트: MK4H/MHUrho
        public KeepBuilder(GameController input, GameUI ui, CameraMover camera, KeepType type)
            : base(input, ui, camera, type.MyTypeInstance, Cost.Free)
        {
            AbleFront = Color.Blue;

            cwUI = new BaseCustomWindowUI(ui, type.Name, "");
        }
예제 #2
0
파일: Keep.cs 프로젝트: MK4H/MHUrho
        Keep(ILevelManager level, IBuilding building, KeepType myType)
            : base(level, building)
        {
            this.myType = myType;

            TileInFront = level.Map.GetContainingTile(building.Center + building.Forward * 3);


            nodes = new Dictionary <ITile, IBuildingNode>();
        }
예제 #3
0
파일: Keep.cs 프로젝트: MK4H/MHUrho
        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;
            }
        }
예제 #4
0
파일: Keep.cs 프로젝트: MK4H/MHUrho
 public static Keep CreateForLoading(ILevelManager level, IBuilding building, KeepType myType)
 {
     return(new Keep(level, building, myType));
 }