示例#1
0
        public OfflinePlayer(IPunter randomPunter, IScorer scorer)
        {
            try
            {
                Log("Init player");

                this.scorer = scorer;
                transport   = new Transport();
                punter      = randomPunter;

                Log("Player initialized");
            }
            catch (Exception e)
            {
                Log(e.Message);
                Log(e.StackTrace);
                throw;
            }
        }
        private static GameState InitGameState(GameStateMessage state, List <MoveCommand> moves, IScorer scorer, IPunter punter)
        {
            state.Moves.AddRange(moves);

            var map = Converter.Convert(state.MapContract, state.Moves);

            scorer.State = state.ScorerState;
            punter.State = state.PunterState;

            var gameState = new GameState {
                Map = map, CurrentPunter = new Punter {
                    Id = state.MyPunter
                }
            };

            return(gameState);
        }
 public OnlineClient(IPunter punter)
 {
     this.punter = punter;
 }
示例#4
0
 public OnlineClient(IPunter punter,
                     ILog log)
 {
     this.punter = punter;
     this.log    = log.Log;
 }