GAM456-SpaceInvaders / SpaceInvaders / 6_Collision / CollisionObserver.cs
CollisionObserver.cs
Raw
using System;
using System.Diagnostics;


namespace SpaceInvaders
{
    public abstract class CollisionObserver : SLink
    {
        //-------------------------------------------------------------------
        //  FIELDS
        //-------------------------------------------------------------------

        public CollisionSubject pSubject;


        //-------------------------------------------------------------------
        //  CONSTRUCTION
        //-------------------------------------------------------------------

        public CollisionObserver()
        {
            this.pSubject = null;
        }


        //-------------------------------------------------------------------
        //  ABSTRACT METHODS
        //-------------------------------------------------------------------

        public abstract void Notify();


        //-------------------------------------------------------------------
        //  VIRTUAL METHODS
        //-------------------------------------------------------------------

        //state pattern
        public virtual void Execute()
        {
            //default does nothing
        }


    } // end class

} // end namespace