示例#1
0
        // set observer fields based on name
        public void set(Subject.Name name, MoveProxy mProxy)
        {
            if (name == Subject.Name.LeftKey)
            {
                this.direction = -2f;
            }
            else if (name == Subject.Name.RightKey)
            {
                this.direction = 2f;
            }

            this.privMoveProxy = mProxy;
            this.name          = name;
        }
示例#2
0
        // composite metho, set delta direction for all children
        public void CompositeSetDelta(float d)
        {
            MoveProxy mpx = (MoveProxy)this.pProxy;

            // set itself first
            mpx.delta = d;

            Component walk = this.pChildHead;

            // move all children (recursively until leaves)
            while (walk != null)
            {
                ((GameObject)walk).CompositeSetDelta(d);
                walk = walk.pNextSibling;
            }
        }
示例#3
0
        public void CompositeAdvance()
        {
            MoveProxy mpx = (MoveProxy)this.pProxy;

            // move itself first
            mpx.y -= 15f;

            Component walk = this.pChildHead;

            // move all children (recursively until leaves)
            while (walk != null)
            {
                ((GameObject)walk).CompositeAdvance();
                walk = walk.pNextSibling;
            }
        }
示例#4
0
 public ShootObserver()
 {
     this.pMissileProxy = (FlyProxy)ProjectileTracker.pMissile.pProxy;
     this.pShipProxy    = (MoveProxy)ProjectileTracker.pShip.pProxy;
 }