Ejemplo n.º 1
0
 private void CreateBasicStateFactories()
 {
     StateFactory.SetInstance(new StateFactory());
     StateFactory.AddFactory(GameStates.Roll, new RollFactory(_gameInfo));
     StateFactory.AddFactory(GameStates.ChooseNextNode, new Factory(new ChooseNextNode()));
     StateFactory.AddFactory(GameStates.EndSpin, new Factory(new EndOfSpinnerSpunLogic()));
     StateFactory.AddFactory(GameStates.Spin, new Factory(_gameInfo.Spinner));
     StateFactory.AddFactory(GameStates.VisuallyMovePlayer, new Factory(new VisuallyMovePlayer()));
     StateFactory.AddFactory(GameStates.LetUserChooseDirection, new Factory(new LetUserChooseDirection()));
     StateFactory.AddFactory(GameStates.Wait, new WaitFactory());
     StateFactory.AddFactory(GameStates.Execute, new Factory(new ExecuteLogic()));
     StateFactory.AddFactory(GameStates.EndExecute, new Factory(new EndOfExecutionLogic()));
     StateFactory.AddFactory(GameStates.ChangeWorld,
                             new Factory(new ChangeWorld(_gameInfo.WorldNodes.Where(i => i.IsChangeable).ToList(),
                                                         _gameInfo.WorldNodes.Where(i => i.BindedLogic.PureLogic is BuyHouse).ToList())));
     StateFactory.AddFactory(GameStates.IncreaseAge, new Factory(new IncreaseAgeCounter()));
     StateFactory.AddFactory(GameStates.EndGame, new Factory(new EndGame(EndGame)));
 }
Ejemplo n.º 2
0
        private void BeginGame()
        {
            CreateHudSystem();
            CreateMenu();
            CreateBasicStateFactories();
            _fsm.Push(StateFactory.GetState(GameStates.Roll));
            _gameInfo.PanCameraToObject(_gameInfo.Spinner);
            _gameStarted = true;

            var houseLogics = _gameInfo.WorldNodes.Select(i => i.BindedLogic.PureLogic).OfType <BuyHouse>();

            foreach (var houseLogic in houseLogics)
            {
                houseLogic.House.ChangePrice(RandomHelper.NextFloat(0.7f, 1.3f));
            }

            Loan.ChangeInterestRates();
        }
Ejemplo n.º 3
0
 public static void SetInstance(StateFactory instance)
 {
     _instance = instance;
 }
Ejemplo n.º 4
0
 public static void SetInstance(StateFactory instance)
 {
     _instance = instance;
 }