/// <summary> /// Constructs the gameState and passes Game and GameStateManager. /// </summary> /// <param name="game">game drawable component</param> /// <param name="manager">the stateManager</param> public GameState(Game game, GameStateManager manager) : base(game) { GameRef = (Game1)game; StateMananger = manager; stateRef = this; }
public Game1() { Content.RootDirectory = "Content"; IsMouseVisible = true; graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = width; graphics.PreferredBackBufferHeight = height; ScreenRectangle = new Rectangle(0, 0, width, height); Components.Add(new InputHandler(this)); stateManager = new GameStateManager(this); TitleScreen = new TitleScreen(this, stateManager); BattleScreen = new BattleScreen(this, stateManager); }
/// <summary> /// Initlialise the game! /// </summary> public Game1() { Content.RootDirectory = "Content"; IsMouseVisible = true; graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = WIDTH; graphics.PreferredBackBufferHeight = HEIGHT; ScreenRectangle = new Rectangle(0, 0, WIDTH, HEIGHT); Components.Add(new Input(this)); stateManager = new GameStateManager(this); Components.Add(stateManager); // default starting screen TitleScreen = new TitleScreen(this, stateManager); BattleScreen = new BattleScreen(this, stateManager); stateManager.ChangeState(TitleScreen); }
/// <summary> /// Constructs the TitleScreen and passes Game and GameStateManager /// </summary> /// <param name="game">the game class</param> /// <param name="manager">its assigned GameStateManager</param> public TitleScreen(Game game, GameStateManager manager) : base(game, manager) { }
/// <summary> /// Constructs the BattleScreen and passes Game and GameStateManager /// </summary> /// <param name="game">the game class</param> /// <param name="manager">its assigned GameStateManager</param> public BattleScreen(Game game, GameStateManager manager) : base(game, manager) { characters = new List<BattleCharacter>(); }
/// <summary> /// pass game and stateManager reference /// </summary> public BattleScreen(Game1 game, GameStateManager man) : base(game, man) { }
/// <summary> /// Set GameRef and StateManager /// </summary> /// <param name="game">Game1 reference</param> /// <param name="man">StateManager that this class belongs to</param> public GameState(Game1 game, GameStateManager man) { GameRef = game; StateManager = man; }