Пример #1
0
 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;
        }