public FowCalcArchetype(int width, int height, int viewDist)
    {
        this.width    = width;
        this.height   = height;
        this.viewDist = viewDist;
        tileCount     = width * height;
        maxSeeThrough = 0;

        //pre-calculate deltas for the given viewdist
        (staticX, staticY) = GetEdgeDeltas(viewDist);
        UnityEngine.Debug.Log(">>> New Archetype");
        for (int i = 0; i < staticX.Length; i++)
        {
            UnityEngine.Debug.Log("x/y: " + staticX[i] + "/" + staticY[i]);
        }

        //copy
        wall     = WorldGrid.TerrainType.Wall;
        resource = WorldGrid.TileOccupation.Resource;
        building = WorldGrid.TileOccupation.Building;

        int padding = PER_JOB_ARRAY_PADDING;

        perJobAlloc = (int)(3.14f * viewDist * viewDist) + padding; //pi*r^2
    }
Exemplo n.º 2
0
    public Node(bool _walkable, Vector3 _worldPos, int _gridX, int _gridY, int _penalty, WorldGrid.TerrainType _terrain, GameObject _token, float _diameter)
    {
        walkable      = _walkable;
        worldPosition = _worldPos;
        gridX         = _gridX;
        gridY         = _gridY;
        basePenalty   = _penalty;
        terrain       = _terrain;

        _token.transform.position = _worldPos;
        _token.SetActive(false);
        token  = _token;
        script = _token.GetComponent <Token>();

        token.transform.localScale *= _diameter;
    }