public ClientScreen()
 {
     qR = new QuadRenderer();
     clientBox = new MessageBox(10, 0, 0);
     serverBox = new MessageBox(10, 624, 0);
     serverBox.IsVisible = false;
     clientBox.IsVisible = false;
     clientState = ClientState.currentInstance;
 }
Beispiel #2
0
        public ClientState()
        {
            _client = new Client();
            respawnTimer = new Timer();
            respawnTimer.AutoReset = true;
            respawnTimer.Elapsed += new ElapsedEventHandler(timer_Elapsed);
            _client.OnMessage = new Client.Callback(MessageCallback);
            _client.OnError = new Client.ErrorCallback(ErrorCallback);
            _client.OnConnect = new Client.Callback(ConnectCallback);
            _client.OnDisconnect = new Client.Callback(DisconnectCallback);
            _messageStack = new MessageStack<GameMessage>(500);
            _infoStack = new MessageStack<string>(10);
            _errorStack = new MessageStack<string>(10);

            if (currentInstance == null)
                currentInstance = this;
            else
                throw new Exception("only one instance of client state allowed");
        }