tactics = $tactics; } public function makeNew(string $name): TacticInfo { return $this->tactics->insert($name); } public function makeNewDefault(): ?TacticInfo { return $this->tactics->insert(self::TACTIC_DEFAULT_NAME); } /** * Tries to retrieve information about a tactic * @param int $id tactic identifier * @return TacticInfo|null or null if the identifier did not match a tactic */ public function get(int $id): ?TacticInfo { return $this->tactics->get($id); } /** * Update the name of a tactic * @param int $id the tactic identifier * @param string $name the new name to set * @return true if the update was done successfully */ public function updateName(int $id, string $name): bool { if ($this->tactics->get($id) == null) { return false; } $this->tactics->updateName($id, $name); return true; } }