/// <summary> /// Creates the balloon, the dwarves, and the initial balloon port. /// </summary> public void CreateInitialEmbarkment() { // If no file exists, we have to create the balloon and balloon port. if (!string.IsNullOrEmpty(ExistingFile)) { return; } BalloonPort port = GenerateInitialBalloonPort(Master.Faction.RoomBuilder, ChunkManager, Camera.Position.X, Camera.Position.Z, 3); CreateInitialDwarves(); PlayerFaction.AddMoney(InitialEmbark.Money); foreach (var res in InitialEmbark.Resources) { PlayerFaction.AddResources(new ResourceAmount(res.Key, res.Value)); } var portBox = port.GetBoundingBox(); ComponentManager.RootComponent.AddChild(EntityFactory.CreateBalloon( portBox.Center() + new Vector3(0, 100, 0), portBox.Center() + new Vector3(0, 10, 0), ComponentManager, Content, GraphicsDevice, new ShipmentOrder(0, null), Master.Faction)); Camera.Target = portBox.Center(); Camera.Position = Camera.Target + new Vector3(0, 15, -15); GenerateInitialObjects(); }
public Body DispatchBalloon() { List <Room> rooms = GetRooms().Where(room => room.RoomData.Name == "BalloonPort").ToList(); if (rooms.Count == 0) { return(null); } Vector3 pos = rooms.First().GetBoundingBox().Center(); return(EntityFactory.CreateBalloon(pos + new Vector3(0, 1000, 0), pos + Vector3.UnitY * 15, Components, GameState.Game.Content, GameState.Game.GraphicsDevice, new ShipmentOrder(0, null), this)); }