public PlayableEntity(
     String name,
     Specy specy,
     //int sighRange,
     Cost cost,
     //float collisionRadius,
     UInt32 hitPoints,
     int size,
     float supply
     //,int targetPriority,
     //Armor armor
     //,List<Armament> armaments
     )
     : base(name, hitPoints)
 {
     this._specy = specy;
     //this._sighRange = sighRange;
     this._cost = cost;
     this._size = size;
     this._supply = supply;
     //this._collisionRadius = collisionRadius;
     //this._targetPriority = targetPriority;
     //this._armor = armor;
     //this._armaments = armaments;
 }
 /// <summary>
 /// Ajoute un nouveau joueur
 /// </summary>
 /// <param name="iptable">La table des IP</param>
 /// <param name="ip">L'adresse IP</param>
 /// <param name="idspecy">La race jouée</param>
 /// <param name="pseudo">Le pseudo du joueur</param>
 public void AddPlayer(IProtocolAdapter ipa, Dictionary<String, int> iptable, String ip, uint idspecy, string pseudo)
 {
     Specy sp;
     switch(idspecy){
         case (uint)PlayerSpecy.ZERG :
         default :
             sp = new Specy("Zerg");
             break;
     }
     iptable.Add(ip, Server.components.Game.getInstance().AddPlayer(sp, pseudo));
     Protocol_handler ph = new Protocol_handler();
     int width = Server.components.Game.getInstance().getMapWidth();
     int height = Server.components.Game.getInstance().getMapHeight();
     ipa.send(ph.Identify_mapSize(width, height));
 }
Esempio n. 3
0
        public Zerg(UInt16 creep_mult,
            String name, Specy specy,
            //int sighRange,
            Cost cost,
            //float collisionRadius,
            UInt32 hitPoints,
            //int targetPriority,
            //Armor armor,
            //List<Armament> armaments,
            float supply, UInt16 pick_size,
            float speed, float hp_regen)
            : base(name,specy,cost,hitPoints,
			//armor,
			supply ,pick_size,speed,hp_regen)
        {
            this._creep_mult = creep_mult;
        }
Esempio n. 4
0
        /// <summary>
        /// Constructeur de player ajoute au player les unites "de bases" (hatchery...)
        /// </summary>
        /// <param name="id">Identifiant du joueur</param>
        /// <param name="specy">Race choisie</param>
        /// <param name="s">Position initiale du joueur</param>
        public Player(uint id, Specy specy, Square s, String pseudo)
        {
            this._vespeneNumber = 0;
            this._mineralNumber = 50;
            this._pseudo = pseudo;
            this._idPlayer = id;
            this._specy = specy;

            //ajout d'unite(drone) au joueur
            for (int n = 0; n < 5; ++n)
            {
                ConcreteEntity u = Server.components.entities.Entities.getInstance().getEntity("drone", Server.components.entities.Entities.getInstance().Id);
                u.addSquare(Game.getInstance().getSquare(new Point(s.Point.X, s.Point.Y + n)));
                this.addConcreteEntity(u.Squares, u);
            }

            // 3 larve
            for (int n = 0; n < 3; ++n)
            {
                ConcreteEntity u = Server.components.entities.Entities.getInstance().getEntity("larvae", Server.components.entities.Entities.getInstance().Id);
                u.addSquare(Game.getInstance().getSquare(new Point(s.Point.X - 1, s.Point.Y + n)));
                this.addConcreteEntity(u.Squares, u);
            }

            // ajout de overland
            ConcreteEntity o = Server.components.entities.Entities.getInstance().getEntity("overlord", Server.components.entities.Entities.getInstance().Id);
            o.addSquare(Game.getInstance().getSquare(new Point(s.Point.X, s.Point.Y + 5)));
            this.addConcreteEntity(o.Squares, o);

            //ajout d'un batiment (hatchery) au joueur
            int bat_id = Server.components.entities.Entities.getInstance().Id;
            PlayableConcreteEntity b = (PlayableConcreteEntity)Server.components.entities.Entities.getInstance().getEntity("hatchery", bat_id);
            //Square firstSquare = Game.getInstance().getSquare(new Point(, s.Point.Y + 1));
            int i = s.Point.X + 1;
            int j = s.Point.Y + 1;
            for (int xmax = i + b.Size; i < xmax; ++i, j = s.Point.Y + 1)
            {
                for (int ymax = j + b.Size; j < ymax; ++j)
                {
                    b.addSquare(Game.getInstance().getSquare(new Point(i, j)));
                }
            }
            this.addConcreteEntity(b.Squares, b);
        }
Esempio n. 5
0
        //private List<ResearchBehavior> _AvaillableResearch;
        /// <summary>
        /// constructeur de Building
        /// </summary>
        /// <param name="name"> nom</param>
        /// <param name="specy"> race </param>
        /// <param name="cost"> prix </param>
        /// <param name="hitPoints"> point de vie</param>
        /// <param name="armor"> armure </param>
        /// <param name="Broodlingproduced"> nombre de broodling crée lor de la destructions</param>
        public Building(
            String name,
            Specy specy,
            // int sighRange,
            Cost cost,
            // float collisionRadius,
            UInt32 hitPoints,
            //int targetPriority,
            //Armor armor,
            //List<Armament> armaments,
            //List<ResearchBehavior> pastResearch,
            //List<Entity> unlockedEntities,
            int Broodlingproduced,
            int size
            )
            : base(name, specy, cost, hitPoints, size,0
			//, armor)
        {
            //this._pastResearch = pastResearch;
            //this._unlockedEntities = unlockedEntities;
            this._broodlingproduced = Broodlingproduced;
        }
Esempio n. 6
0
 /// <summary>
 /// création d'un nouveau player
 /// </summary>
 /// <param name="sp"> race choisie par le player </param>
 public int AddPlayer(Specy sp, String pseudo)
 {
     // trouver une position
     Square s = this._mapArray.getStartPoint();
     if (s != null)
     {
         this._players.Insert(this._player_count, new Player((uint)this._player_count, sp, s, pseudo));
         return this._player_count ++;
     }
     return -1;
 }