/** * Creates new race based on params. * @param string $name * @return Race */ public static function create($name) { if (empty(Races::$available[$name])) { return null; } $data = Races::$available[$name]; $race = new Race(); $race->setName($data['name']); $race->setTradeContracts($data['trades']); $race->setSpecials($data['specials']); $race->setTechnologies($data['technologies']); $race->setUnits($data['units']); return $race; }