public void SpawnPirate(SpaceModel spawnPoint) { //If the pirate is dead check type and create a new one if (pirateModel == null && !spawnPoint.Occupied()) { switch (pirateType) { case PirateModel.PirateType.Scout: pirateModel = PirateModel.CreateScoutPirate(spawnPoint, this); break; case PirateModel.PirateType.Frigate: pirateModel = PirateModel.CreateFrigatePirate(spawnPoint, this); break; case PirateModel.PirateType.Platform: pirateModel = PirateModel.CreatePlatformPirate(spawnPoint, this); break; case PirateModel.PirateType.Dreadnought: pirateModel = PirateModel.CreateDreadnaughtPirate(spawnPoint, this); break; case PirateModel.PirateType.Destroyer: pirateModel = PirateModel.CreateDestroyerPirate(spawnPoint, this); break; } Dispatcher.InvokeAsync(() => { modelLink.CreatePirateView(pirateModel); spawnPoint.OccupySpace(pirateModel); }); } }
public void UpdatePirateLocation(SpaceModel location) { base.currentSpace.LeaveSpace(); base.currentSpace = location; location.OccupySpace(this); }