Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BonusOrObstacle"/> class.
 /// </summary>
 /// <param name="physicsWorld">The physics world.</param>
 /// <param name="spriteBatch">The sprite batch to use for rendering.</param>
 /// <param name="contentManager">The game's content manager.</param>
 /// <param name="description">The entity description.</param>
 /// <param name="setting">The entity's settings.</param>
 public BonusOrObstacle(ref World physicsWorld, SpriteBatch spriteBatch, ContentManager contentManager, InteractiveEntityDescription description, ObstacleOrBonusSetting setting)
     : base(ref physicsWorld, description)
 {
     this.Type = setting.IsBonus ? InteractiveEntityType.Bonus : InteractiveEntityType.Obstacle;
     this.name = setting.Name;
     this.Value = setting.Value;
     this.PhysicsBody.UserData = new InteractiveEntityUserData(this.Type, this.Value);
     this.InitializeAndLoad(spriteBatch, contentManager);
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BonusOrObstacle"/> class.
 /// </summary>
 /// <param name="physicsWorld">The physics world.</param>
 /// <param name="spriteBatch">The sprite batch to use for rendering.</param>
 /// <param name="contentManager">The game's content manager.</param>
 /// <param name="description">The entity description.</param>
 /// <param name="setting">The entity's settings.</param>
 public BonusOrObstacle(ref World physicsWorld, SpriteBatch spriteBatch, ContentManager contentManager, InteractiveEntityDescription description, ObstacleOrBonusSetting setting)
     : base(ref physicsWorld, description)
 {
     this.Type  = setting.IsBonus ? InteractiveEntityType.Bonus : InteractiveEntityType.Obstacle;
     this.name  = setting.Name;
     this.Value = setting.Value;
     this.PhysicsBody.UserData = new InteractiveEntityUserData(this.Type, this.Value);
     this.InitializeAndLoad(spriteBatch, contentManager);
 }