/// <summary> /// constructor /// </summary> public GameView(EventManager eventManager) { if (eventManager == null) { throw new ArgumentNullException("eventManager"); } eventManager.OnMapBuiltEvent += new EventHandler<MapBuiltEventArgs>(Subscribe); eventManager.OnEntityPlaceEvent += new EventHandler<EntityPlaceEventArgs>(Subscribe); eventManager.OnEntityMoveEvent += new EventHandler<EntityMoveEventArgs>(Subscribe); Events.Tick += new EventHandler<TickEventArgs>(this.Tick); Events.Quit += new EventHandler<QuitEventArgs>(this.Quit); this.width = 424; this.height = 440; this.backSprites = new ArrayList(); this.frontSprites = new ArrayList(); if (File.Exists(Path.Combine(dataDirectory, "boing.wav"))) { filePath = ""; } try { this.sound = new Sound(Path.Combine(filePath, Path.Combine(dataDirectory, "boing.wav"))); } catch (SdlException) { // Linux audio problem } }
/// <summary> /// /// </summary> /// <param name="eventManager"></param> public Game(EventManager eventManager) { this.gameStatus = GameStatus.Preparing; this.eventManager = eventManager; this.players = new ArrayList(); this.players.Add(new Player(eventManager)); this.map = new Map(eventManager); }
public static void Run() { //if (CheckInstance() == null) //{ EventManager eventManager = new EventManager(); InputController inputController = new InputController(eventManager); Game game = new Game(eventManager); game.Start(); inputController.Go(); //} }
/// <summary> /// constructor /// </summary> public Player(EventManager eventManager) { this.entityList = new ArrayList(); this.entityList.Add(new Entity(eventManager)); }
/// <summary> /// /// </summary> /// <param name="eventManager"></param> public Map(EventManager eventManager) { this.eventManager = eventManager; this.sectors = new Sector[9]; }
/// <summary> /// constructor /// </summary> public InputController(EventManager eventManager) { this.eventManager = eventManager; }