Ejemplo n.º 1
0
        public static Game NewGame()
        {
            InfoHelper.StartANewGame();
            // initialize logic of Investigation API
            // var investigationService = new InvestigationService(gameRequestor);


            // initialize http requestor
            var gameRequestor = new GameRequestor(new HttpClient());


            // initialize logic of Game API
            var gameService = new GameService(gameRequestor);
            // create a container of user information
            var userInfo = new UserInfo();
            // start a new game
            var result = gameService.StartNewGame().Result;
            // initialize user information with a object-obejct mapper
            var mapper = MapperHelper.Build();

            userInfo = mapper.Map <GameInfo, UserInfo>(result);
            userInfo.TurnsInARound = 0;


            // initialize logic of Shop APIs
            var shopService = new ShopService(gameRequestor);
            // initialize strategy of items buying
            var solution = new NewbieProcurementSolution();
            // initialize logic of store
            var store = new Store(solution, shopService, userInfo);


            // initialize logic of Message APIs
            var missionService = new MissionService(gameRequestor);
            // initialize strategy of task choosing
            var warrior = new NewbieWarrior();
            // initialize logic of mission picking and performing
            var missionBoard = new MissionBoard(warrior, missionService, userInfo);

            return(new Game(userInfo, store, missionBoard));
        }
Ejemplo n.º 2
0
 public void SetUp()
 {
     _shopService = new Mock <IShopService>();
     _solution    = new NewbieProcurementSolution();
     _items       = new List <ItemInfo>();
 }