public Inventory(MineralDNA mineral) { this.Ship = null; this.Part = null; this.Mineral = mineral; this.Count = 1; this.Volume = mineral.Volume; this.Mass = mineral.Density * mineral.Volume; this.Token = TokenGenerator.NextToken(); }
private void StoreInStation(Cargo cargo) { Inventory inventory; if (cargo is Cargo_Mineral) { Cargo_Mineral cargoMineral = (Cargo_Mineral)cargo; MineralDNA mineralDNA = ItemOptionsAstMin2D.GetMineral(cargoMineral.MineralType, cargoMineral.Volume); inventory = new Inventory(mineralDNA); } else if (cargo is Cargo_ShipPart) { Cargo_ShipPart cargoPart = (Cargo_ShipPart)cargo; inventory = new Inventory(cargoPart.PartDNA); } else { throw new ApplicationException("Unknown type of cargo: " + cargo.GetType().ToString()); } _spaceDock.AddInventory(inventory, true); }
public ChangeInstruction(Point3D add_Position, Vector3D add_Velocity, Vector3D add_AngVel, MineralDNA mineral, Mineral[] remove_Minerals) : this(add_Position, add_Velocity, add_AngVel, null, mineral, null, remove_Minerals) { }
private ChangeInstruction(Point3D add_Position, Vector3D add_Velocity, Vector3D add_AngVel, AsteroidDNA asteroid, MineralDNA mineral) { this.InstructionType = MapPopulationManager.InstructionType.Add; this.Add_Position = add_Position; this.Add_Velocity = add_Velocity; this.Add_AngVel = add_AngVel; this.Asteroid = asteroid; this.Mineral = mineral; this.Remove_Asteroids = null; this.Remove_Minerals = null; }