Exemplo n.º 1
0
    /// <summary>
    /// Prepares this object to take in wall bounds.
    /// </summary>
    public void Initialize(bool wrapX, bool wrapY)
    {
        WrapX = wrapX;
        WrapY = wrapY;

        currentWallsState = InitializeWallsState.TakingWalls;

        WallBounds         = new List <RecBounds>();
        MirroredWallBounds = new List <RecBounds>();
    }
Exemplo n.º 2
0
    /// <summary>
    /// Should be called when no more walls will be added.
    /// Combines all the walls and then creates them.
    /// </summary>
    public void FinalizeWalls(bool[,] levelMap)
    {
        if (currentWallsState != InitializeWallsState.TakingWalls)
        {
            throw new InvalidOperationException("Invalid call!");
        }

        currentWallsState = InitializeWallsState.CombiningWalls;

        CombineWalls();
        CalculateLines(levelMap);

        currentWallsState = InitializeWallsState.Done;
    }