コード例 #1
0
        public void Restore(Solver solver, List <Marble> marbles)
        {
            foreach (var marble in marbles)
            {
                //delete and deactivate
                solver.Marbles[marble.X * 13 + marble.Y] = marble;
                solver.MarbleTypeCount[marble.Type]++;

                //increase metallevel if quicksilver, also try to activate next metal
                if (marble.Type == 5)
                {
                    solver.MetalLevel--;
                }

                solver.MarbleCount++;

                solver.UpdateAll();
            }
        }
コード例 #2
0
        public void Pair(Solver solver, List <Marble> marbles)
        {
            foreach (var marble in marbles)
            {
                //delete marble
                solver.Marbles[marble.X * 13 + marble.Y] = null;
                solver.MarbleTypeCount[marble.Type]--;

                //increase metallevel if quicksilver, also try to activate next metal
                if (marble.Type == 5)
                {
                    solver.MetalLevel++;
                }

                solver.MarbleCount--;

                solver.UpdateAll();
            }
        }