/// <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> /// Initializes a new instance of the <see cref="ServerPacketHandler"/> class. /// </summary> /// <param name="server">The server.</param> /// <exception cref="ArgumentNullException"><paramref name="server" /> is <c>null</c>.</exception> public ServerPacketHandler(Server server) { if (server == null) throw new ArgumentNullException("server"); _server = server; _sayHandler = new SayHandler(server); }
public WitConversation(string token, string conversationId, T initialContext, MergeHandler merge, SayHandler say, ActionHandler action, StopHandler stop) { if (token == null || conversationId == null || merge == null || say == null || action == null) { throw new Exception("Please check WitConversation constructor parameters."); } client = new WitClient(token); this.conversationId = conversationId; _merge = merge; _say = say; _action = action; _stop = stop; context = initialContext; }