public static function FromOtherMission(Mission $otherMission) { return Transportation::NewTransportation($otherMission->Fleet(), $otherMission->Fleet()->OriginalColony()); }
echo "<br/>"; echo "<br/>"; echo "Current colony:"; Helper::var_dump_pre($user->CurrentColony()->ID()); $units = array("light_fighter" => 10, "small_cargo_ship" => 20, "cruiser" => 10); $extrafleet = ShipFleet::FromList($units, $user->CurrentColony(), 0); //Helper::var_dump_pre( $user->CurrentColony()->Fleet() ); echo "Adding some extra units to original fleet: "; $user->CurrentColony()->Fleet()->AddToFleet($extrafleet); $user->CurrentColony()->Fleet()->UpdateDatabase(); $t_units = array("light_fighter" => 5, "small_cargo_ship" => 5, "cruiser" => 3); $t_fleet = ShipFleet::FromList($t_units, $user->CurrentColony(), 0); echo "Splitting up some units from the original fleet: "; $fleets = $user->CurrentColony()->Fleet()->SplitFleet($t_fleet); // Let's send a part of the fleet on a transport mission $transport = Transportation::NewTransportation($fleets["new_fleet"], $colony); //$transport->AddToDatabase(); $transport->Validate(); $transport->AddToDatabase(); //$user->CurrentColony()->Fleet()->DeductFromFleet( $extrafleet ); //Helper::var_dump_pre( $user->CurrentColony()->Fleet() ); //Helper::var_dump_pre( $user->Officers() ); //Helper::var_dump_pre( $user->CurrentColony()->BuildingUnits() ); echo memory_get_peak_usage() / 1024; /*$user->Technologies()->ChangeTechnology( "espionage_technology", 5 ); $changes = $user->Technologies()->Changes(); $techs = $user->Technologies()->Members(); Helper::var_dump_pre( "espionage_technology" );