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)); }
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)); }