Beispiel #1
0
        public Board(Battle.Configurations.Configurations configuration)
        {
            /*
             * Things the board needs to have:
             * # of Jewels
             * Jewel Dimensions (Board Configs)
             * Where Jewels are
             * Board Mechanics(Start Turn, End Turn)
             */

            this.configuration = configuration;
            boardData          = new BoardData(configuration);

            ProcessCascadeBoardMechanics   = new CascadeBoardMechanics(this);
            ProcessEndGameBoardMechanics   = new EndGameBoardMechanics(this);
            ProcessSelectBoardMechanics    = new SelectBoardMechanics(this);
            ProcessStartGameBoardMechanics = new StartGameBoardMechanics(this);
            ProcessSwapBoardMechanics      = new SwapBoardMechanics(this);
            UnselectBoardMechanics         = new UnselectBoardMechanics(this);
            ActivateAbilityMechanics       = new ActivateAbilityMechanics(this);
            InvokeActivateAbilityMechanics = new InvokeActivateAbilityMechanics(this);
            RemoveJewelBoardMechanics      = new RemoveJewelBoardMechanics(this);

            Mechanics.Add(ProcessCascadeBoardMechanics);
            Mechanics.Add(ProcessEndGameBoardMechanics);
            Mechanics.Add(ProcessSelectBoardMechanics);
            Mechanics.Add(ProcessStartGameBoardMechanics);
            Mechanics.Add(ProcessSwapBoardMechanics);
            Mechanics.Add(UnselectBoardMechanics);
            Mechanics.Add(ActivateAbilityMechanics);
            Mechanics.Add(InvokeActivateAbilityMechanics);
            Mechanics.Add(RemoveJewelBoardMechanics);
        }
Beispiel #2
0
        //----------------------------------------------------------------------------------------------------------

        #region Initialization

        public TurnBasedFsm(IGameController handler, IGameData gameData, Battle.Configurations.Configurations configurations) :
            base(handler)
        {
            Configurations = configurations;
            Handler        = handler;
            GameData       = gameData;
            Initialize();
        }
Beispiel #3
0
        //----------------------------------------------------------------------------------------------------------

        #region Constructor

        protected BaseBattleState(TurnBasedFsm fsm, IGameData gameData, Battle.Configurations.Configurations configurations)
        {
            Fsm            = fsm;
            GameData       = gameData;
            Configurations = configurations;

            //Subscribe game events
            GameEvents.Instance.AddListener(this);
            IsInitialized = true;
        }
Beispiel #4
0
        //----------------------------------------------------------------------------------------------------------

        #region Constructor

        protected TurnState(TurnBasedFsm fsm, IGameData gameData, Battle.Configurations.Configurations configurations) : base(fsm, gameData,
                                                                                                                              configurations)
        {
            var game = GameData.RuntimeGame;

            //get player according to the seat
            Player = game.TurnLogic.GetPlayer(Seat);

            //register turn state
            Fsm.RegisterPlayerState(Player, this);
        }
Beispiel #5
0
        public Player(PlayerSeat seat, IRoster Roster, Battle.Configurations.Configurations configurations = null)
        {
            Configurations = configurations;
            Seat           = seat;
            roster         = Roster;

            StartTurnMechanics     = new StartTurnMechanics(this);
            FinishTurnMechanics    = new FinishTurnMechanics(this);
            SwapTurnMechanics      = new SwapTurnMechanics(this);
            SwapMoheMechanics      = new SwapMoheMechanics(this);
            ChargeAbilityMechanics = new ChargeAbilityMechanics(this);
            //UseAbilityMechanics = new UseAbilityMechanics(this);
            GainJewelBonusMechanics = new GainJewelBonusMechanics(this);
        }
Beispiel #6
0
        //----------------------------------------------------------------------------------------------------------

        #region Constructor

        public Game(List <IPlayer> players, IRuntimeBoard GameBoard, Battle.Configurations.Configurations configurations)
        {
            Configurations          = configurations;
            TurnLogic               = new Battle.Model.TurnLogic.TurnLogic(players);
            ProcessPreStartGame     = new PreStartGameMechanics(this);
            ProcessStartGame        = new StartGameMechanics(this);
            ProcessStartPlayerTurn  = new StartPlayerTurnMechanics(this);
            ProcessFinishPlayerTurn = new FinishPlayerTurnMechanics(this);
            ProcessTick             = new TickTimeMechanics(this);
            ProcessSwap             = new SwapMechanics(this);
            ProcessFinishGame       = new FinishGameMechanics(this);
            gameBoard               = GameBoard;

            AddMechanic(ProcessPreStartGame);
            AddMechanic(ProcessStartGame);
            AddMechanic(ProcessStartPlayerTurn);
            AddMechanic(ProcessFinishPlayerTurn);
            AddMechanic(ProcessTick);
            AddMechanic(ProcessSwap);
            AddMechanic(ProcessFinishGame);
            Logger.Log <Game>("Game Created", "blue");
            Debug.Log("Game Created!");
        }
Beispiel #7
0
        //----------------------------------------------------------------------------------------------------------

        #region Constructor

        public EndBattleState(TurnBasedFsm fsm, IGameData gameData, Battle.Configurations.Configurations configurations) : base(fsm, gameData,
                                                                                                                                configurations)
        {
        }
Beispiel #8
0
        //----------------------------------------------------------------------------------------------------------

        #region Constructor

        public BottomPlayerState(TurnBasedFsm fsm, IGameData gameData, Battle.Configurations.Configurations configurations) : base(fsm, gameData, configurations)
        {
        }
Beispiel #9
0
        //----------------------------------------------------------------------------------------------------------

        #region Constructor

        protected AiTurnState(TurnBasedFsm fsm, IGameData gameData, Battle.Configurations.Configurations configurations) : base(fsm, gameData,
                                                                                                                                configurations)
        {
            AiModule = new AiModule(Player, GameData.RuntimeGame);
        }
Beispiel #10
0
 public BoardData(Battle.Configurations.Configurations configuration)
 {
     jewelMap = new IRuntimeJewel[configuration.boardConfigs.width, configuration.boardConfigs.height];
 }