Exemple #1
0
    internal void FillFill(Game game, Vector3IntRef a_, Vector3IntRef b_)
    {
        int startx = MathCi.MinInt(a_.X, b_.X);
        int endx   = MathCi.MaxInt(a_.X, b_.X);
        int starty = MathCi.MinInt(a_.Y, b_.Y);
        int endy   = MathCi.MaxInt(a_.Y, b_.Y);
        int startz = MathCi.MinInt(a_.Z, b_.Z);
        int endz   = MathCi.MaxInt(a_.Z, b_.Z);

        for (int x = startx; x <= endx; x++)
        {
            for (int y = starty; y <= endy; y++)
            {
                for (int z = startz; z <= endz; z++)
                {
                    if (fillarea.Count() > game.fillAreaLimit)
                    {
                        ClearFillArea(game);
                        return;
                    }
                    if (!game.IsFillBlock(game.map.GetBlock(x, y, z)))
                    {
                        fillarea.Set(x, y, z, game.map.GetBlock(x, y, z));
                        game.SetBlock(x, y, z, game.d_Data.BlockIdFillArea());
                        game.RedrawBlock(x, y, z);
                    }
                }
            }
        }
    }