Пример #1
0
        void CreateGame(IGameController controller)
        {
            var turnBasedArgs = new RuntimeGame.GameArgs
            {
                Controller     = controller,
                Dispatcher     = _dispatcher,
                GameParameters = gameParameters
            };

            CurrentGameInstance = new RuntimeGame(turnBasedArgs);
        }
Пример #2
0
        public void CreateGame(IGameController controller, IPlayer localPlayer, IPlayer remotePlayer)
        {
            var turnBasedArgs = new RuntimeGame.GameArgs
            {
                Controller     = controller,
                Dispatcher     = _dispatcher,
                GameParameters = gameParameters,
                LocalPlayer    = localPlayer,
                RemotePlayer   = remotePlayer
            };

            CurrentGameInstance = new RuntimeGame(turnBasedArgs);
        }
Пример #3
0
        public override void Setup()
        {
            base.Setup();
            var args = new RuntimeGame.GameArgs
            {
                Dispatcher     = Dispatcher,
                GameParameters = Parameters,
                Controller     = new GameObject("Controller").AddComponent <GameController>()
            };

            EventReceived = false;
            Game          = new RuntimeGame(args);
            Game.StartGame();
        }
Пример #4
0
        public BattleFsm(RuntimeGame.GameArgs args, IGame game) : base(args.Controller)
        {
            Controller = args.Controller;

            var fsmArgs = new BattleFsmArguments
            {
                Fsm            = this,
                Game           = game,
                Dispatcher     = args.Dispatcher,
                GameParameters = args.GameParameters
            };

            var user  = new UserPlayer(fsmArgs);
            var enemy = new AiPlayer(fsmArgs);
            var start = new StartBattle(fsmArgs);
            var end   = new EndBattle(fsmArgs);

            RegisterState(user);
            RegisterState(enemy);
            RegisterState(start);
            RegisterState(end);

            Initialize();
        }