예제 #1
0
        public void ValueManagerGetGridValueIncludingOffsetSpecialCase3x3Test()
        {
            ValuesManager <TileBase> valueManager = new ValuesManager <TileBase>(inputReader.ReadInputToGrid());

            //Debug.Log(valueManager.GetFrequencyFromIndex(2));
            Assert.True(
                valueManager.GetGridValueIncludingOffset(-2, -2) == valueManager.GetGridValue((int)valueManager.GetGridSize().x - 2, (int)valueManager.GetGridSize().y - 2) &&
                valueManager.GetGridValueIncludingOffset((int)valueManager.GetGridSize().x + 2, (int)valueManager.GetGridSize().y + 2) == valueManager.GetGridValue(2, 2) &&
                valueManager.GetGridValueIncludingOffset(-2, (int)valueManager.GetGridSize().y + 1) == valueManager.GetGridValue((int)valueManager.GetGridSize().x - 2, 1) &&
                valueManager.GetGridValueIncludingOffset((int)valueManager.GetGridSize().x + 1, -2) == valueManager.GetGridValue(1, (int)valueManager.GetGridSize().y - 2)
                );
        }
예제 #2
0
        public void ValueManagerGetGridValueIncludingOffsetSpecialCaseTest()
        {
            ValuesManager <TileBase> valueManager = new ValuesManager <TileBase>(inputReader.ReadInputToGrid());

            //Debug.Log(valueManager.GetFrequencyFromIndex(2));
            Assert.True(
                valueManager.GetGridValueIncludingOffset(-1, -1) == valueManager.GetGridValue((int)valueManager.GetGridSize().x - 1, (int)valueManager.GetGridSize().y - 1) &&
                valueManager.GetGridValueIncludingOffset((int)valueManager.GetGridSize().x, (int)valueManager.GetGridSize().y) == valueManager.GetGridValue(0, 0) &&
                valueManager.GetGridValueIncludingOffset(-1, (int)valueManager.GetGridSize().y) == valueManager.GetGridValue((int)valueManager.GetGridSize().x - 1, 0) &&
                valueManager.GetGridValueIncludingOffset((int)valueManager.GetGridSize().x, -1) == valueManager.GetGridValue(0, (int)valueManager.GetGridSize().y - 1)
                );
        }