Esempio n. 1
0
        public ActionResult <BaseResult> Leave(PlayerData data)
        {
            var chain = new CheckIfPlayerExists(data.id)
                        .Then(new ConcludeAndExecute(
                                  g => { g.EliminatePlayer(data.id); return(new BaseResult()); }
                                  ));

            var game = Game.GetInstance();

            return(chain.ProcessChain(game));
        }
Esempio n. 2
0
        public ActionResult <BaseResult> Get(Guid id)
        {
            var chain = new CheckIfPlayerExists(id)
                        .Then(new ConcludeAndExecute(
                                  g => new GamestateResult(new GamePlayerState(g, id))
                                  ));

            var game = Game.GetInstance();

            return(chain.ProcessChain(game));
        }