Example #1
0
        public void RemoveTarget(int row, int column, TargetValueEnum value, int round)
        {
            var entity = _world.CreateEntityWith <StateRemoveTargetsEvent>(out StateRemoveTargetsEvent eventData);

            var target = new Target
            {
                Column = column,
                Row    = row,
                Round  = round,
                Value  = value,
            };

            eventData.Targets = new List <Target> {
                target
            };
        }
Example #2
0
        public void TargetReached(Step lastStep, DirectionEnum direction, TargetValueEnum targetValue)
        {
            var round = lastStep.Round + 1;

            TriggerClearBoardEvent(lastStep.Round);

            var stepChange = 0;

            switch (targetValue)
            {
            case TargetValueEnum.AddWall:
                TriggerAddWallEvent();
                break;

            case TargetValueEnum.RemoveWall:
                TriggerRemoveWallEvent(1);
                break;

            case TargetValueEnum.AddTailRemoveTwoWall:
                TriggerRemoveWallEvent(2);
                stepChange = 1;
                break;

            case TargetValueEnum.RemoveTailAddWall:
                TriggerAddWallEvent();
                stepChange = -1;
                break;
            }

            TriggerAddNewStepEvent(
                lastStep.Row,
                lastStep.Column,
                lastStep.StartNumber + stepChange,
                lastStep.StartNumber + stepChange,
                round,
                direction
                );

            TriggerUpdateTargetEvent(round);
            IncreaseScore();
        }