Example #1
0
        public Field(int width, int height, FieldHelper helper = null)
        {
            this.Width = width;
            this.Height = height;

            this._field = new Color?[width, height];
            this.Helper = helper ?? new FieldHelper();
        }
Example #2
0
        public void Test_IsPositionOutOfField_PositionIsOutOfField_ReturnsTrue()
        {
            var field = new Color?[,]{
                {null}
            };
            var subject = new FieldHelper();
            var position = new Vector2(-1, -1);

            Assert.That(subject.IsPositionOutOfField(position, field), Is.True);
        }
Example #3
0
        public void Test_IsPositionBlocked_PositionIsFree_ReturnsFalse()
        {
            var field = new Color?[,]{
                {null}
            };
            var subject = new FieldHelper();
            var vector = new Vector2(0, 0);

            Assert.That(subject.IsPositionBlocked(vector, field), Is.False);
        }
Example #4
0
        public void Test_IsPositionOutOfField_PositionIsNotOutOfField_ReturnsFalse()
        {
            var field = new Color?[,]{
                {null}
            };
            var subject = new FieldHelper();
            var position = new Vector2(0, 0);

            Assert.That(subject.IsPositionOutOfField(position, field), Is.False);
        }
Example #5
0
        public void Test_IsPositionBlocked_PositionIsBlocked_ReturnsTrue()
        {
            var field = new Color?[,]{
                {Color.Red}
            };
            var subject = new FieldHelper();
            var vector = new Vector2(0, 0);

            Assert.That(subject.IsPositionBlocked(vector, field), Is.True);
        }