/// <summary> /// Allows the game component to perform any initialization it needs to before starting /// to run. This is where it can query for any required services and load content. /// </summary> public override void Initialize() { this.gdevice = this.game.GraphicsDevice; this.camera = this.game.Services.GetService(typeof(ICameraService)) as ICameraService; this.wallcube = new CubePrimitive(this.gdevice, InternalMap.GridSize); if (this.camera == null) { throw new InvalidOperationException("ICameraService not found."); } base.Initialize(); }
public Wall(Game game, WallNode wallnode, Vector3 position) : base(game) { this.wall = wallnode; this.position = position; this.game = game; this.gdevice = this.game.GraphicsDevice; this.camera = this.game.Services.GetService(typeof(ICameraService)) as ICameraService; this.wallCube = new CubePrimitive(this.gdevice, InternalMap.GridSize); if (this.camera == null) { throw new InvalidOperationException("ICameraService not found."); } }
public WayPoint(GraphicsDevice graphicDevice, Vector3 centerPos) : base(graphicDevice, WayPoint.CubeSize) { this.centerPos = centerPos; this.cube = new CubePrimitive(graphicDevice, WayPoint.CubeSize); }