Ejemplo n.º 1
0
    public void CreateSimulatedGridOriginal()
    {
        _simulatedGridOriginal = new SimulatedBlock[_setting.GridWidth, _setting.GridHeight];

        for (int y = 0; y < _setting.GridHeight; y++)
        {
            for (int x = 0; x < _setting.GridWidth; x++)
            {
                if (_grid[x, y] != null)
                {
                    _simulatedGridOriginal[x, y] = new SimulatedBlock(_grid[x, y]);
                }
            }
        }

        _simulatedGrid = new SimulatedBlock[_setting.GridWidth, _setting.GridHeight];

        CopyOriginalToSimulatedGrid();

        if (_grid.CurrentGroup == null)
        {
            return;
        }
        _simulatedGroup = new SimulatedGroup();
        _simulatedGroup.Simulate(_grid.CurrentGroup);
    }
Ejemplo n.º 2
0
 public void LocationShouldBeAffectedByLocationInTheGroup()
 {
     var block = new SimulatedBlock();
     block.LocationInTheGroup = new Coord(0, 2);
     block.SetLocation(new Coord(1, 2));
     Assert.AreEqual(new Coord(1, 4), block.Location);
 }
Ejemplo n.º 3
0
    public void CreateSimulatedGridOriginal()
    {
        _simulatedGridOriginal = new SimulatedBlock[_setting.GridWidth, _setting.GridHeight];

        for (int y = 0; y < _setting.GridHeight; y++)
        {
            for (int x = 0; x < _setting.GridWidth; x++)
            {
                if (_grid[x, y] != null)
                {
                    _simulatedGridOriginal[x, y] = new SimulatedBlock(_grid[x, y]);
                }
            }
        }

        _simulatedGrid = new SimulatedBlock[_setting.GridWidth, _setting.GridHeight];

        CopyOriginalToSimulatedGrid();

        if (_grid.CurrentGroup == null)
        {
            return;
        }
        _simulatedGroup = new SimulatedGroup();
        _simulatedGroup.Simulate(_grid.CurrentGroup);
    }
Ejemplo n.º 4
0
 public void ShouldIgnoreLocationInTheGroupWhenFixedOnGridIsTrue()
 {
     var block = new SimulatedBlock();
     block.LocationInTheGroup = new Coord(0, 2);
     block.FixedOnGrid = true;
     block.SetLocation(new Coord(1, 2));
     Assert.AreEqual(new Coord(1, 2), block.Location);
 }
Ejemplo n.º 5
0
    public void LocationShouldBeAffectedByLocationInTheGroup()
    {
        var block = new SimulatedBlock();

        block.LocationInTheGroup = new Coord(0, 2);
        block.SetLocation(new Coord(1, 2));
        Assert.AreEqual(new Coord(1, 4), block.Location);
    }
Ejemplo n.º 6
0
    public void ShouldIgnoreLocationInTheGroupWhenFixedOnGridIsTrue()
    {
        var block = new SimulatedBlock();

        block.LocationInTheGroup = new Coord(0, 2);
        block.FixedOnGrid        = true;
        block.SetLocation(new Coord(1, 2));
        Assert.AreEqual(new Coord(1, 2), block.Location);
    }