public GameObject GetAdornment(Cell.States cell)
    {
        switch (cell)
        {
        case Cell.States.Empty:
        case Cell.States.Disabled:
        case Cell.States.Black:
        case Cell.States.White:
        case Cell.States.BlackAndWhite:
            return(null);

        case Cell.States.BlackJeweledBoth:
        case Cell.States.WhiteJeweledBoth:
            return(prefabJewelBoth);

        case Cell.States.BlackJeweledHorz:
        case Cell.States.WhiteJeweledHorz:
            return(prefabJewelHorz);

        case Cell.States.WhiteJeweledVert:
        case Cell.States.BlackJeweledVert:
            return(prefabJewelVert);

        default:
            return(null);
        }
    }
示例#2
0
            void Mark(IEnumerable <Vector2> points, Cell.States state)
            {
                foreach (var point in points.Where(IsInBounds))
                {
                    cells[point.X, point.Y].State = state;
                }

                DistancesCalculator.Update(AllCoords, this);
            }
示例#3
0
            void Mark(Vector2 point, Cell.States state)
            {
                cells[point.X, point.Y].State = state;
                var subjectPoints = Enumerable.Range(0, Width)
                                    .Select(x => new Vector2(x, point.Y))
                                    .Union(Enumerable.Range(0, Height)
                                           .Select(y => new Vector2(point.X, y)));

                DistancesCalculator.Update(subjectPoints, this);
            }
示例#4
0
        public void TestBlackState(
            [Values(Cell.States.Black, Cell.States.BlackJeweledBoth)] Cell.States state)
        {
            var cell = new Cell(0, 0)
            {
                State = state
            };

            Assert.IsTrue(cell.IsBlack);
            Assert.IsTrue(Cell.IsStateBlack(cell.State));
            Assert.IsTrue(cell.IsSameColor(Cell.States.Black));
            Assert.IsFalse(cell.IsWhite);
            Assert.IsFalse(Cell.IsStateWhite(cell.State));
            Assert.IsFalse(cell.IsSameColor(Cell.States.White));
            if (state == Cell.States.BlackJeweledBoth)
            {
                Assert.IsTrue(cell.IsJeweled);
            }
            else
            {
                Assert.IsFalse(cell.IsJeweled);
            }
        }
 public void PopulateCell(PlayfieldPoint p, Cell.States state)
 {
     Playfield.GetCell(p).State = state;
 }