Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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;
 }