Beispiel #1
0
 public PathRequest(Vector3 start, Vector3 end, bool canFly, int unitPID, Action <Node[], bool> callback, Pathfinding.Heuristic heuristic)
 {
     this.pathStart    = start;
     this.pathEnd      = end;
     this.callback     = callback;
     this.canFLy       = canFly;
     this.heuristic    = heuristic;
     this.unitPlayerID = unitPID;
 }
Beispiel #2
0
 //default abstract constructor
 protected Unit()
 {
     movementSpeed     = 10;
     canFly            = false;
     heuristic         = Pathfinding.Heuristic.TileDistance;
     unitType          = UnitTypes.UnitUndefined;
     unitPlayerId      = -1;
     maxHealth         = 0;
     currentHealth     = 0;
     damage            = 0;
     defense           = 0;
     minRange          = 0;
     maxRange          = 0;
     accuracy          = 0;
     evasion           = 0;
     cost              = 0;
     canAttack         = true;
     movementSpeedLeft = 0;
 }
Beispiel #3
0
 // parameterized abstract constructor
 protected Unit(int _movementSpeed, bool _canfly, Pathfinding.Heuristic _hf, UnitTypes _type, int _unitPlayerId, int _maxHealth,
                int _currentHealth, int _damage, int _defense, int _minRange, int _maxRange, int _accuracy, int _evasion, int _cost, bool _canAttack)
 {
     movementSpeed     = _movementSpeed;
     canFly            = _canfly;
     heuristic         = _hf;
     unitType          = _type;
     unitPlayerId      = _unitPlayerId;
     maxHealth         = _maxHealth;
     currentHealth     = _currentHealth;
     damage            = _damage;
     defense           = _defense;
     minRange          = _minRange;
     maxRange          = _maxRange;
     accuracy          = _accuracy;
     evasion           = _evasion;
     cost              = _cost;
     canAttack         = _canAttack;
     movementSpeedLeft = movementSpeed;
 }
Beispiel #4
0
    public static void RequestPath(Vector3 pathStart, Vector3 pathEnd, bool canFly, int unitPlayerID, Action <Node[], bool> callback, Pathfinding.Heuristic heuristic)
    {
        PathRequest newRequest = new PathRequest(pathStart, pathEnd, canFly, unitPlayerID, callback, heuristic);

        instance.pathRequestQueue.Enqueue(newRequest);
        instance.TryProcessNext();
    }