public VehiclePrototype(float size, VehicleDrive drive, VehicleControlsConfig controlConfig, GunMount guns) { VehicleSize = size; VehicleDrive = drive; ControlConfig = controlConfig; Guns = guns; }
public async Task <IActionResult> PutVehicleDrive(int id, VehicleDrive vehicleDrive) { if (id != vehicleDrive?.Id) { return(BadRequest()); } _context.Entry(vehicleDrive).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VehicleDriveExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <VehicleDrive> > PostVehicleDrive(VehicleDrive vehicleDrive) { _context.VehicleDrive.Add(vehicleDrive); await _context.SaveChangesAsync(); return(CreatedAtAction("GetVehicleDrive", new { id = vehicleDrive?.Id }, vehicleDrive)); }
private void SpawnVehicles() { const float vehicleSize = 5.5f; GunMount gunMount = MakeGunMount(vehicleSize); AsteroidsControlData data = new AsteroidsControlData(190f, 175f, 6.25f, 7.25f); VehicleDrive asteroidsDrive = AsteroidsControlsFactory.MakeDrive(data); VehiclePrototype asteroidsPrototype = new VehiclePrototype(vehicleSize, asteroidsDrive, AsteroidsControlsFactory.StandardConfig, gunMount); Vector2 position = new Vector2(kArenaWidth / 4, kArenaHeight / 4); Orientation2 orientation = new Orientation2(MathHelper.Pi); DynamicTransform2 initialPlacement = new DynamicTransform2(position, orientation); SpawnVehicle(asteroidsPrototype, initialPlacement); //TODO: This returns the assigned ID. Use it to setup proper control pipeline position = new Vector2(3 * kArenaWidth / 4, 3 * kArenaHeight / 4); orientation = new Orientation2(0f); initialPlacement = new DynamicTransform2(position, orientation); SpawnVehicle(asteroidsPrototype, initialPlacement); }