Beispiel #1
0
        public void OnRemoveItem_RemovesItem()
        {
            var position      = Vector2Int.one;
            var item          = new TestBoardItem(position);
            var boardRegistry = new BoardRegistry <TestBoardItem>();

            boardRegistry.Add(item);

            Assert.That(boardRegistry.Get(position) == item);

            boardRegistry.Remove(item);

            Assert.That(boardRegistry.Get(position) == null);
        }
Beispiel #2
0
        public void OnGetItem_WhenNoItemExists_ReturnsNull()
        {
            var position      = Vector2Int.one;
            var boardRegistry = new BoardRegistry <TestBoardItem>();

            Assert.That(boardRegistry.Get(position) == null);
        }
Beispiel #3
0
        public void OnAddItem_AddsItemAtCorrectPosition()
        {
            var item          = new TestBoardItem(Vector2Int.one);
            var boardRegistry = new BoardRegistry <TestBoardItem>();

            boardRegistry.Add(item);

            Assert.That(boardRegistry.Get(Vector2Int.one) == item);
        }
Beispiel #4
0
 public IActor Get(Vector2Int at)
 {
     return(_actors.Get(at));
 }