示例#1
0
        public void TestCoordinateFromIndex(int xSize, int ySize, int curIndex, int expectedX, int expectedY)
        {
            LayeredImage li     = new LayeredImage(xSize, ySize);
            Vector2      retVal = li.GetCoordinatesFromIndex(curIndex);

            Assert.Equal(expectedX, retVal.x);
            Assert.Equal(expectedY, retVal.y);
        }
示例#2
0
        public void TestIndexFromCoordinates(int xSize, int ySize, int xCoord, int yCoord, int expectedIndex)
        {
            LayeredImage li  = new LayeredImage(xSize, ySize);
            Vector2      vec = new Vector2();

            vec.x = xCoord;
            vec.y = yCoord;
            int retVal = li.GetIndexFromCoordinate(vec);

            Assert.Equal(retVal, expectedIndex);
        }
示例#3
0
        public void SolveDayEight()
        {
            string resultsFile = "adventDayEightSolution.png";
            string dataFile    = "adventDayEight.txt";
            string outFile     = Path.Combine(baseDir, resultsFile);
            string inFile      = Path.Combine(baseDir, dataFile);

            string[]     sourceData = ReadAllLines(inFile);
            int          width      = 25;
            int          height     = 6;
            LayeredImage li         = new LayeredImage(width, height);

            li.ImportImageData(sourceData[0]);
            //int ret = li.ValidateImageLayers();
            li.DrawImage(outFile);
        }