示例#1
0
        public static void Main(string[] args)
        {
            Noun zPlayer = new Player();

            MyNouns.Add(zPlayer);
            var          zObj = new Thing();
            ScreenCell2D loc  = new ScreenCell2D(10, 5);

            zObj.GoTo(loc);
            MyNouns.Add(zObj);
            MyNouns.Add(new Alien());
            DoInit(MyNouns);
            ObjectStatus status = new ObjectStatus();

            while (status.state != ObjectStatus.ActiveState.Dead)
            {
                foreach (IMovable item in MyNouns)
                {
                    item.OnMove();
                    item.OnDraw();
                }
                zPlayer.GetStatus(ref status);
            }
            DoDeInit(MyNouns);
        }
示例#2
0
 public override void OnMove()
 {
     if (calc.Next(this.speed, out ScreenCell2D next))
     {
         calc.Plot(this.playerPoint, ScreenCell2D.GetRandomPoint());
     }
     playerPoint = next;
 }
示例#3
0
        internal static Boolean CheckLocation(ScreenCell2D location, List <IMovable> results)
        {
            bool bGots = false;

            foreach (var mover in MyNouns)
            {
                if (mover.GetLocation().Equals(location))
                {
                    bGots = true;
                    results.Add(mover);
                }
            }
            return(bGots);
        }