startTime = time(); if (!$mpMap) { return; } $this->name = FORMATTER::stripDirtyCodes($mpMap->name); $this->rawName = $mpMap->name; $this->uid = $mpMap->uId; $this->fileName = $mpMap->fileName; $this->authorLogin = $mpMap->author; $this->environment = $mpMap->environnement; $this->authorTime = $mpMap->authorTime; $this->goldTime = $mpMap->goldTime; $this->copperPrice = $mpMap->copperPrice; $this->mapType = $mpMap->mapType; $this->mapStyle = $mpMap->mapStyle; $this->nbCheckpoints = $mpMap->nbCheckpoints; $this->nbLaps = $mpMap->nbLaps; $this->authorNick = $this->authorLogin; } /** * Get's the gameType of the Current Map * * @return string */ public function getGame() { switch($this->environment) { case 'Storm': return "sm"; case 'Canyon': case 'Stadium': case 'Valley': return "tm"; default: return ""; } } /** * Checks if a map Update is available * * @return bool */ public function updateAvailable() { if ($this->mx && ($this->lastUpdate < strtotime($this->mx->updated) || $this->uid != $this->mx->uid)) { return true; } else { return false; } } }