Example #1
0
        public override void Enter(IActor actor)
        {
            base.Enter(actor);

            if (ColorsMatch(actor))
            {
                actor.ChangeSpeed(this);
            }

            enterDirection = actor.GetDirection();
        }
Example #2
0
        public override void Exit(IActor actor)
        {
            base.Exit(actor);

            if (actor.GetDirection() == -enterDirection)
            {
                if (ColorsMatch(actor))
                {
                    actor.ChangeSpeed(this);
                }
            }
        }