public static void setMovingstate(ContentLoader.TextureNames movingstateParameter) { if (movingstate == ContentLoader.TextureNames.empty) { movingstate = movingstateParameter; } }
//public Int32 electricityCapacity; //public Int32 oxygenCapacity; public Capsule(ContentLoader.TextureNames name, Rectangle startPositionPart, Int32 weightParameter) { partName = name; partPosition = startPositionPart; partTexture = ContentLoader.Textures[partName]; partWeight = weightParameter; type = partType.capsule; //electricityCapacity = elec; //oxygenCapacity = oxy; }
//public Int32 efficiency; //public Int32 consumption; public Engine(ContentLoader.TextureNames name, Rectangle startPositionPart, Int32 weightParameter, Int32 eff, Int32 consump, Int32 thr, Int32 isp) { partName = name; partPosition = startPositionPart; partTexture = ContentLoader.Textures[partName]; partWeight = weightParameter; type = partType.engine; thrust = thr; efficiency = eff; consumption = consump; ISP = isp; }
//public Int32 fuelCapacity; //public Int32 fuelWeight; public Tank(ContentLoader.TextureNames name, Rectangle startPositionPart, Int32 weightParameter, Int32 fuel, Int32 fweight) { partName = name; partPosition = startPositionPart; partTexture = ContentLoader.Textures[partName]; partWeight = weightParameter; type = partType.tank; fuelCapacity = fuel; fuelWeight = fweight; //this._fuelCapacity = fuel; //this._fuelWeight = fweight; }
public void checkPartDrop() { // See if part is dropped in rectangle. if (currentTouches.Count > 0) { if (movingstate != ContentLoader.TextureNames.empty && grid.Contains(touchPoints)) { gridTouched = true; } } else { if (gridTouched) { // Add to stack. //rocketStack.Push(masterList[movingstate]); switch (movingstate) { case ContentLoader.TextureNames.capsule_test: rocketStack.Push(new Capsule(ContentLoader.TextureNames.capsule_test, new Rectangle(0, 0, 101, 101), 50)); break; case ContentLoader.TextureNames.capsule_1: rocketStack.Push(new Capsule(ContentLoader.TextureNames.capsule_1, new Rectangle(0, 0, 101, 101), 50)); break; case ContentLoader.TextureNames.tank_1: rocketStack.Push(new Tank(ContentLoader.TextureNames.tank_1, new Rectangle(0, 0, 101, 101), 120, 100, 1)); break; case ContentLoader.TextureNames.engine_1: rocketStack.Push(new Engine(ContentLoader.TextureNames.engine_1, new Rectangle(0, 0, 101, 101), 150, 100, 5, 1000, 1)); break; } partStack.Push(new Rectangle(190, (rocketStack.Count * 101), 101, 101)); gridTouched = false; grid.Y += 101; // Set totals back to 0. stages = 0; partWeightTotal = 0; electricityCapacityTotal = 0; oxygenCapacityTotal = 0; fuelCapacityTotal = 0; fuelWeightTotal = 0; maxThrust = 0; // Calculate new rocket totals. foreach (Part part in rocketStack) { part.stageNumber = stages; if (part.type == Part.partType.engine) { stages++; } partWeightTotal += part.partWeight; electricityCapacityTotal += part.electricityCapacity; oxygenCapacityTotal += part.oxygenCapacity; fuelCapacityTotal += part.fuelCapacity; fuelWeightTotal += part.fuelWeight; maxThrust += part.thrust; } } movingstate = ContentLoader.TextureNames.empty; } }