public void TestNextStep()
 {
     ObjectStrategy nextStep = new ObjectStrategy();
       ObjectStrategy testStrategy = new ObjectStrategy();
       testStrategy.NextStep = nextStep;
       Assert.AreEqual(nextStep, testStrategy.NextStep);
 }
示例#2
0
        public Kitty(PointF pos)
        {
            this.position.X = pos.X - 100;
            this.position.Y = pos.Y - 100;

            this.size = new SizeF(250, 200);

            strategy = new KittyLifeStrategy(this);
        }
示例#3
0
        public override bool move()
        {
            if (strategy == null) {
                strategy = NoOpKittyStrategy.INSTANCE;
            }

            if (strategy.isExecutable()) {
                return strategy.execute();
            }

            return false;
        }