Ejemplo n.º 1
0
    public void SetPutFlag(FarmObject farmObject, int gridX, int gridY, bool putFlag)
    {
        FarmField.Field       field        = this.GetField();
        FarmGrid.GridPosition gridPosition = farmObject.AdjustGridPosition(gridX, gridY);
        bool impassable = !FarmUtility.IsWalkBuild(farmObject.facilityID);

        for (int i = 0; i < farmObject.sizeY; i++)
        {
            int num = (gridPosition.y + i) * field.fieldHorizontal;
            for (int j = 0; j < farmObject.sizeX; j++)
            {
                int num2 = num + gridPosition.x + j;
                if (num2 >= 0 && field.grids.Count > num2)
                {
                    FarmGrid.Grid value = field.grids[num2];
                    value.put         = putFlag;
                    value.impassable  = impassable;
                    field.grids[num2] = value;
                }
            }
        }
    }