private List <ZPoint> _interdit;//list contenant les bord de la zone

        public ZoneDeplacement(Texture2D texture, ZEcart ecart, ZTaille taille, ZPoint depart, Map map, int posStart, int rayon) : base(ecart, taille, depart)
        {
            _texture  = texture;
            _map      = map;
            _rayon    = rayon;
            _posStart = posStart;
            _depart   = depart;
            _interdit = new List <ZPoint>();

            GetGroupe(depart);
        }
Beispiel #2
0
        public PathFinding(Trajet trajet, ZoneDeplacement zone)
        {
            _mapPosStart = zone._posStart;

            _tMax  = new ZTaille(zone.GetTaille());
            _ecart = zone.GetEcart();

            _trajet = trajet;

            InitializeMap(zone);

            PathFinder pathFinder            = new PathFinder(_searchParameters, 4);
            List <System.Drawing.Point> path = pathFinder.FindPath();

            ApplyPath(path);
            //ShowRoute("The algorithm should find a direct path without obstacles:", path);
        }
Beispiel #3
0
        private float _time;      //temps d'attente avant un clic

        public PlaceUnit(Texture2D textureFleche, Texture2D textureZone, Map map, List <Unit> units, Vector2 position)
        {
            _units    = units;
            _posPerso = position;//A la construction la position est la position du perso
            //      _position = position;

            _ecart       = new ZEcart(Constantes.CASE_W, Constantes.CASE_H);
            _mapPosStart = map._posStart;

            _unit           = new Unit(_units.Last());
            _unit._position = _posPerso;

            int id = _units.IndexOf(_unit);

            _unit = _units[id];

            _zone = new ZoneDeplacement(textureZone, _ecart,
                                        new ZTaille((int)map._tailleEnPixel.X, (int)map._tailleEnPixel.Y),
                                        new ZPoint((int)_posPerso.X - _mapPosStart, (int)_posPerso.Y),
                                        map, _mapPosStart, _unit._rayon);

            _trajet = new Trajet(textureFleche, _zone, _ecart._x, _ecart._y);
        }