Example #1
0
 public TownController(GameWorld gameWorld, ISaveGameRepository saveGameRepository, IAsciiArtRepository asciiArtRepository, IDice dice)
 {
     _gameWorld = gameWorld;
     _saveGameRepository = saveGameRepository;
     _asciiArtRepository = asciiArtRepository;
     _dice = dice;
 }
 public NewGameController(ISaveGameRepository saveGameRepository, IAsciiArtRepository asciiArtRepository, IStatsGenerator statsGenerator, GameWorld gameWorld)
 {
     _saveGameRepository = saveGameRepository;
     _asciiArtRepository = asciiArtRepository;
     _statsGenerator = statsGenerator;
     _gameWorld = gameWorld;
 }
Example #3
0
 public InnController(GameWorld gameWorld, ISaveGameRepository saveGameRepository, IAsciiArtRepository asciiArtRepository, IDice dice)
 {
     _gameWorld = gameWorld;
     _saveGameRepository = saveGameRepository;
     _asciiArtRepository = asciiArtRepository;
     _dice = dice;
     _title = "Welcome to the Tolbooth Tavern. The food ain't great and the beds aren't soft. But it's the only Inn in town.";
 }
Example #4
0
        private void Control_Loaded(object sender, RoutedEventArgs e)
        {
            this.model         = new GameModel();
            this.highscoreRepo = new HighscoreRepository();
            Window win = Window.GetWindow(this);

            if ((win as MainWindow).AutoOrManual)
            {
                this.saveGameRepo = new ManualSaveGameRepository((win as MainWindow).LoadFilePath);
            }
            else
            {
                this.saveGameRepo = new AutoSaveGameRepository();
            }

            this.loadigLogic = new LoadingLogic(this.model, this.saveGameRepo, this.highscoreRepo);
            this.model       = this.loadigLogic.Play();
            this.gameLogic   = new GameLogic(this.model);
            this.renderer    = new GameRenderer(this.model);
            if (win != null)
            {
                win.KeyDown             += this.Win_KeyDown;
                win.MouseLeftButtonDown += this.Left_MouseButtonDown;
                win.MouseMove           += this.Win_MouseMove;
            }

            this.updateTimer           = new System.Timers.Timer();
            this.updateTimer.Elapsed  += new ElapsedEventHandler(this.UpdateScreen);
            this.updateTimer.Interval  = 30;
            this.updateTimer.AutoReset = true;
            this.shootOnce             = new DispatcherTimer();
            this.shootOnce.Interval    = TimeSpan.FromMilliseconds(this.rnd.Next(1000, 2000));
            this.shootOnce.Tick       += this.ShootingEnemies;
            this.moveOnce               = new DispatcherTimer();
            this.moveOnce.Interval      = TimeSpan.FromMilliseconds(this.rnd.Next(200, 500));
            this.moveOnce.Tick         += this.MoveEnemies;
            this.moveBossTimer          = new DispatcherTimer();
            this.moveBossTimer.Interval = TimeSpan.FromMilliseconds(800);
            this.moveBossTimer.Tick    += this.MoveBoss;
            this.levelTimer             = new DispatcherTimer();
            this.levelTimer.Interval    = TimeSpan.FromMilliseconds(200);
            this.levelTimer.Tick       += this.LevelTimer_Tick;

            if (!this.model.GameIsPaused)
            {
                this.updateTimer.Enabled = true;
                this.levelTimer.Start();
            }

            this.InvalidateVisual();
        }
 public SaveGameDivisionService(ISaveGameRepository <Division> saveGameDivisionRepository)
 {
     _saveGameDivisionRepository = saveGameDivisionRepository;
 }
Example #6
0
 public CombatantDatabase(IEnumerable <CombatantReference> combatantReferences, ISaveGameRepository saveRepository)
     : this(combatantReferences, saveRepository.CurrentSave)
 {
 }
 public LoadGameController(ISaveGameRepository saveGameRepository, IAsciiArtRepository asciiArtRepository, GameWorld gameWorld)
 {
     _saveGameRepository = saveGameRepository;
     _asciiArtRepository = asciiArtRepository;
     _gameWorld = gameWorld;
 }
        public SaveGameManager(ISaveGameRepository saveGameRepository)
        {
            repository = saveGameRepository;

            this.Games = repository.GetAllSaveGames();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="LoadingLogic"/> class.
 /// </summary>
 /// <param name="gameModel">Defines a gamestate.</param>
 /// <param name="saveGameRepository">Defines the repository of the gamesaving.</param>
 /// <param name="highscoreRepository">Defines the repository of the highscore system.</param>
 public LoadingLogic(IGameModel gameModel, ISaveGameRepository saveGameRepository, IHighscoreRepository highscoreRepository)
 {
     this.gameModel           = gameModel;
     this.saveGameRepository  = saveGameRepository;
     this.highscoreRepository = highscoreRepository;
 }
Example #10
0
 public SaveGameSettingsService(ISaveGameRepository <Division> saveGameRepository)
 {
     _saveGameRepository = saveGameRepository;
 }
Example #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GameOverWindow"/> class.
 /// </summary>
 /// <param name="logic">loadinglogic repo.</param>
 /// <param name="sgRepo">savegame repo.</param>
 public GameOverWindow(ILoadingLogic logic, ISaveGameRepository sgRepo)
 {
     this.logic  = logic;
     this.sgRepo = sgRepo;
     this.InitializeComponent();
 }