/// <summary> /// Handles initialization of the GameScreen. This will be invoked after the GameScreen has been /// completely and successfully added to the ScreenManager. It is highly recommended that you /// use this instead of the constructor. This is invoked only once. /// </summary> public override void Initialize() { _gameControls = new GameplayScreenControls(this); _dragDropHandler = new DragDropHandler(this); _socket = ClientSockets.Instance; _world = new World(this, new Camera2D(GameData.ScreenSize), new UserInfo(Socket)); _world.MapChanged += World_MapChanged; _sayHandler = new SayHandler(this); _profanityHandler = new ProfanityHandler(); // Create some misc goodies that require a reference to the Socket _equipmentInfoRequester = new EquipmentInfoRequester(UserInfo.Equipped, Socket); _inventoryInfoRequester = new InventoryInfoRequester(UserInfo.Inventory, Socket); // Other inits InitializeGUI(); _characterTargeter = new CharacterTargeter(World); // NOTE: Test lighting _userLight = new Light { Size = new Vector2(512), IsEnabled = false }; DrawingManager.LightManager.Add(_userLight); }
/// <summary> /// Handles initialization of the GameScreen. This will be invoked after the GameScreen has been /// completely and successfully added to the ScreenManager. It is highly recommended that you /// use this instead of the constructor. This is invoked only once. /// </summary> public override void Initialize() { _gameControls = new GameplayScreenControls(this); _dragDropHandler = new DragDropHandler(this); _socket = ClientSockets.Instance; _world = new World(this, new Camera2D(GameData.ScreenSize), new UserInfo(Socket)); _world.MapChanged += World_MapChanged; // Create some misc goodies that require a reference to the Socket _equipmentInfoRequester = new EquipmentInfoRequester(UserInfo.Equipped, Socket); _inventoryInfoRequester = new InventoryInfoRequester(UserInfo.Inventory, Socket); // Other inits InitializeGUI(); _characterTargeter = new CharacterTargeter(World); // NOTE: Test lighting _userLight = new Light { Size = new Vector2(512), IsEnabled = false }; DrawingManager.LightManager.Add(_userLight); }