Exemple #1
0
 public void SetUp()
 {
     IPAddress ipAddr = Dns.Resolve(Dns.GetHostName()).AddressList.First();
     endPoint = new IPEndPoint(ipAddr, 10060);
     tcpClientA = new TcpClient();
     tcpClientB = new TcpClient();
     messenger = new SocketMessageTransmitter();
     protocol = new Protocol();
 }
Exemple #2
0
        //constructors
        public GameManager()
        {
            protocol = new Protocol();
            gameList = new List<Game>();
            eventRiser = new GameEventRiser();

            eventRiser.MoveEvent += new GameEventRiser.Move(Move);
            eventRiser.ConfirmEvent += new GameEventRiser.Confirm(Confirm);
            eventRiser.RejectEvent += new GameEventRiser.Reject(Reject);
            eventRiser.ExitEvent += new GameEventRiser.Exit(Exit);
        }
Exemple #3
0
        //constructors
        public Server(Listener listener, ClientManager clientManager, GameManager gameManager)
        {
            this.listener = listener;
            this.clientManager = clientManager;
            this.gameManager = gameManager;

            messager = new SocketMessageTransmitter();
            protocol = new Protocol();
            notifier = new Notifier(protocol);
            loginEventRiser = new LoginEventRiser();

            loginEventRiser.ConnectEvent += Connect;
            listener.NewConnection += NewConnection;
            clientManager.NewGame += NewGame;
            gameManager.GameOverEvent += GameOver;
            gameManager.FreeUserEvent += clientManager.AddClient;
        }
Exemple #4
0
 public Notifier(Protocol protocol)
 {
     this.protocol = protocol;
 }