Exemple #1
0
        public ClaimsOfficeRoom Build()
        {
            var greeting = new[]
            {
                "Welcome to the claims office.",
                "You can type [help] for a list of the store commands.",
                "To leave the office type exit."
            };

            var listings = new ClaimListings();
            var claim1   = _gameState.MineClaims.Add(
                new MineClaim(
                    ChipDensity.Normal,
                    SiteHardness.Hard
                    ));

            var claim2 = _gameState.MineClaims.Add(
                new MineClaimFactory().BuildSite());

            listings.Add(new ClaimListing(claim2, 10, 15, SurveyResults.NoSurvey()));
            listings.Add(new ClaimListing(claim1, 10, 15, SurveyResults.GetFromClaim(claim1)));

            var claimsOffice = new ClaimsOfficeRoom(
                _gameState,
                greeting,
                _baseCommandsGroup.Join(new ClaimsOfficeCommandsGroupFactory(listings).Build()),
                listings
                );

            return(claimsOffice);
        }
Exemple #2
0
        public DiggerControlRoom Build()
        {
            var greeting = new string[]
            {
                "Welcome to digger control.", "From here you can prepare your diggers to dig."
            };
            var controlRoom = new DiggerControlRoom(
                _gameState,
                greeting,
                _baseCommandsGroup.Join(new ControlRoomCommandsGroupFactory().Build())
                );

            return(controlRoom);
        }
        public MinerStore Build()
        {
            var greeting = new[]
            {
                "Welcome to the miners store.", "You can type [help] for a list of the store commands.",
                "To leave the store type exit."
            };
            var storeState = new StoreInventory();
            var storeItems = _gateway.StoreItems.GetAll();

            foreach (var item in storeItems)
            {
                if (item.BuyingPrice == 0)
                {
                    storeState.ItemsForSale.Add(new StoreItem
                    {
                        Price = item.SellingPrice,
                        Count = item.MinCount,
                        Item  = _gateway.GameItems.GetAll().First(gi => gi.Id == item.GameItemId)
                    });
                }
                else
                {
                    storeState.ItemsBuying.Add(new StoreItem
                    {
                        Price = item.BuyingPrice,
                        Item  = _gateway.GameItems.GetAll().First(gi => gi.Id == item.GameItemId)
                    });
                }
            }

            var store = new MinerStore(
                _gameState,
                greeting,
                _baseCommandsGroup.Join(new StoreCommandsGroupFactory(_gameState, storeState).Build())
                );

            store.StoreState = storeState;
            return(store);
        }