Example #1
0
    // Computes the flooding
    // Does not generate the floodable tiles, it has already been done at the start of the turn with PredictFlooding
    public void RecomputeFlooding()
    {
        if (_latestFloodCommand != null)
        {
            _latestFloodCommand.Undo();
        }
        FloodMapCommand floodMapCommand = new FloodMapCommand();

        _latestFloodCommand = floodMapCommand;
        CommandManager.Instance.ExecuteCommand(floodMapCommand);
        OnFloodDone?.Invoke();
    }
Example #2
0
    private void PredictFlooding()
    {
        _latestFloodCommand = null;
        RecreateClusters();
        // First pass on the flooding, we just compute the possible flooded tiles
        PrepareFloodedTilesCommand prepareFloodedTilesCommand = new PrepareFloodedTilesCommand();

        CommandManager.Instance.ExecuteCommand(prepareFloodedTilesCommand);

        // Second pass, we compute flooded tiles, counting the structures
        RecomputeFlooding();
    }