Example #1
0
        private bool CheckPrevious(Body body)
        {
            isFulfilled = currentInformable.Previous.IsFulfilled(body);

            if (isFulfilled)
            {
                isFulfilled = CheckCurrent(body);
            }
            else
            {
                if (currentInformable.Type == Types.action)
                {
                    currentInformable.Convert <BaseAction>().Reset();
                }

                else if (currentInformable.Type == Types.joint)
                {
                    currentInformable.Convert <Joint>().SetPreviousAsActive();
                }

                currentInformable.Previous.Canceled();
                currentInformable.Canceled();
                currentInformable = currentInformable.Previous.Convert <Informable>();
                currentInformable.Write(body);
                currentInformable.Draw(body);
            }

            return(isFulfilled);
        }
Example #2
0
        private bool CheckCurrent(Body body)
        {
            isFulfilled = currentInformable.IsFulfilled(body);

            if (isFulfilled)
            {
                currentInformable.PlayFullfilledSound();
                currentInformable.Fulfilled();

                if (currentInformable.Next == null)
                {
                    isFulfilled = true;
                }
                else
                {
                    currentInformable = currentInformable.Next.Convert <Informable>();
                    currentInformable.Unfulfilled();

                    if (currentInformable.Type == Types.joint)
                    {
                        currentInformable.Convert <Joint>().SetPreviousAsInactive();
                    }

                    isFulfilled = false;
                }
            }
            else
            {
                currentInformable.Write(body);
                currentInformable.Draw(body);
                currentInformable.PlayValue();
            }

            return(isFulfilled);
        }