/* * Splits two Cargo Clients * client : The Cargo Client to be split * capacity : The max amount of tons the Aircraft can hold */ public static Client_Cargo[] SplitCargoClient(Client_Cargo client, double capacity) { Client_Cargo[] tab = new Client_Cargo[2]; tab[0] = new Client_Cargo(capacity, client.AirportDestination); tab[1] = new Client_Cargo(client.TonsOfCargo - capacity, client.AirportDestination); return(tab); }
/* * Merges two Cargo Clients together * first : The first Cargo Client to be merged * second : The second Cargo Client to be merged */ public static Client_Cargo MergeCargoClient(Client_Cargo first, Client_Cargo second) { first.TonsOfCargo += second.TonsOfCargo; return(first); }