Beispiel #1
0
    public bool EditHexagon(Vector3 initialWorldCoordinate, Vector3 endWorldCoordinate,
                            int typeID, float height, PaintLayer paintLayer)
    {
        bool     isDirty = false;
        Vector2i initialGridCoordinate = HexagonUtils.ConvertOrthonormalToHexaSpace(initialWorldCoordinate);
        Vector2i endGridCoordinate     = HexagonUtils.ConvertOrthonormalToHexaSpace(endWorldCoordinate);

        IEnumerable <Vector2i> line = HexagonUtils.GetLine(initialGridCoordinate, endGridCoordinate);

        foreach (Vector2i gridCoordinate in line)
        {
            isDirty |= EditHexagon(gridCoordinate, typeID, height, paintLayer);
        }
        return(isDirty);
    }