public static function NewTransportation(ShipFleet $fleet, Colony $colony) { global $GR_missionDatabaseIDs; $fleet->MissionType($GR_missionDatabaseIDs["transportation"]); $transport = new Transportation(); $transport->Fleet($fleet); $transport->ReceivingColony($colony); $transport->ScheduledTime($transport->Duration() + time()); return $transport; }
public function VerifySameColonyAndMission(ShipFleet $otherFleet, $throwException = false) { // Verify if these fleets are on the same colony and not on a mission if ($this->OriginalColony()->Equals($otherFleet->OriginalColony())) { if ($this->MissionType() == 0 && $otherFleet->MissionType() == 0) { return true; } } if ($throwException) { throw new Exception("The given fleet is not on the same colony and/or on a mission!"); } return false; }