* @category Class * @license https://www.gnu.org/licenses/lgpl-3.0.en.html GNU Lesser General Public License * @link www.splendidbear.org * @since 2026. 04. 21. * * @extends PersistentProxyObjectFactory */ class StepFactory extends PersistentProxyObjectFactory { protected function defaults(): array { return [ 'row' => self::faker()->numberBetween(0, 15), 'col' => self::faker()->numberBetween(0, 15), 'wBomb' => self::faker()->boolean(), 'player' => self::faker()->randomElement(['red', 'blue']), 'revealedCells' => null, 'playedGame' => PlayedGameFactory::new(), 'created' => new DateTime(), ]; } public static function class(): string { return Step::class; } public function mine(): self { return $this->with(['wBomb' => true]); } public function safe(): self { return $this->with(['wBomb' => false]); } public function forPlayer(string $player): self { return $this->with(['player' => $player]); } public function withRevealedCells(array $cells): self { return $this->with(['revealedCells' => $cells]); } }