Beispiel #1
0
        public override IEntity Clone()
        {
            DeadEnemy enemy = new DeadEnemy(Texture, new Vector2(Position.X, Position.Y))
            {
                currentFrame = currentFrame,
                time         = time
            };

            return(enemy);
        }
 public override void Draw(SpriteBatch spriteBatch)
 {
     if (DeadEnemy == null)
     {
         base.Draw(spriteBatch);
     }
     else
     {
         DeadEnemy.Draw(spriteBatch);
     }
 }
 protected override void Clone(ref IEntity entity)
 {
     base.Clone(ref entity);
     if (EnemyState != null)
     {
         ((AbstractEnemy)entity).EnemyState = EnemyState.Clone((AbstractEnemy)entity);
         ((AbstractEnemy)entity).EnemyState.Enter();
     }
     if (DeadEnemy != null)
     {
         ((AbstractEnemy)entity).DeadEnemy = (AbstractEnemy)DeadEnemy.Clone();
     }
 }