public Joueur(string name, IPAddress ip, Emetteur em) { this._name = name; UiUnique = new Guid(DateTime.Now.Millisecond,0,1,new byte[]{4,2,5,4,4,4,4,4}); this.Adresse = ip; this.EmetteurJoueur = em; }
//public event CarteRecueHandler CarteRecue; //public delegate void CarteRecueHandler(object sender, EventArgs ev); public Game1() { _graphics = new GraphicsDeviceManager(this); this._graphics.PreferredBackBufferHeight = 600; this._graphics.PreferredBackBufferWidth = 800; this._graphics.ApplyChanges(); this.IsMouseVisible = true; IPAddress ip = GestionReseau.GetMyLocalIp(); this._emmeteur = new Emetteur(ip.ToString(), Constantes.PORT_ENVOIE); PortReception = GestionReseau.TrouverPort(1500); this._recepteur = new Recepteur(PortReception, this); this._listeTextureCarte = new Dictionary<string, Texture2D>(); this._listeCarte = new Dictionary<string, CarteEcran>(); this._deplacementPerFrame = new Vecteur[4]; this._deplacementPerFrame[0] = new Vecteur(0, TailleCaseY / NombreTickDeplacement); this._deplacementPerFrame[1] = new Vecteur(TailleCaseX / NombreTickDeplacement, 0); this._deplacementPerFrame[2] = Vecteur.Inverse(_deplacementPerFrame[0]); this._deplacementPerFrame[3] = Vecteur.Inverse(_deplacementPerFrame[1]); Content.RootDirectory = "Content"; }
private void IndiquerPortJoueur(string p, Joueur j) { int port = Int32.Parse(p); var tempo = new Emetteur(j.Adresse.ToString(), port); j.EmetteurJoueur = tempo; }