Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions config/game/commander_school.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
commander_school:
credits_cost: 2500
minimum_experience: 100
maximum_experience: 210
points: 5
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 5 additions & 4 deletions config/services.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
imports:
- { resource: ./game/commander_school.yaml }
- { resource: ./game/faction_bonuses.yaml }
- { resource: ./game/factions.yaml }
- { resource: ./game/ship_categories.yaml }

- { resource: ../src/Modules/Ares/Resource/config/config.yml }
- { resource: ../src/Modules/Artemis/Resource/config/config.yml }
- { resource: ../src/Modules/Athena/Resource/config/config.yml }
Expand Down Expand Up @@ -145,10 +150,6 @@ services:
$password: '%env(default::REDIS_PASSWORD)%'
$timeout: "%redis_timeout%"

App\Shared\Infrastructure\EventListener\MixpanelListener:
arguments:
$environment: '%kernel.environment%'

App\Modules\Travel\Domain\Service\CalculateTravelTime:

App\Modules\Travel\Domain\Service\GetTravelDuration:
5 changes: 5 additions & 0 deletions src/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App;

use App\Modules\Ares\Infrastructure\DependencyInjection\CommanderSchoolExtension;
use App\Modules\Ares\Infrastructure\DependencyInjection\ShipCategoryExtension;
use App\Modules\Demeter\Infrastructure\DependencyInjection\FactionBonusExtension;
use App\Modules\Demeter\Infrastructure\DependencyInjection\FactionExtension;
Expand All @@ -17,6 +18,10 @@ protected function build(ContainerBuilder $container): void
{
parent::build($container);

$commanderSchoolExtension = new CommanderSchoolExtension();
$container->registerExtension($commanderSchoolExtension);
$container->loadFromExtension($commanderSchoolExtension->getAlias());

$factionExtension = new FactionExtension();
$container->registerExtension($factionExtension);
$container->loadFromExtension($factionExtension->getAlias());
Expand Down
6 changes: 3 additions & 3 deletions src/Modules/Ares/Domain/Event/Commander/AffectationEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
use App\Modules\Zeus\Resource\TutorialResource;
use App\Shared\Domain\Event\TutorialEvent;

class AffectationEvent implements TutorialEvent
readonly class AffectationEvent implements TutorialEvent
{
public function __construct(
public readonly Commander $commander,
public readonly Player $player,
public Commander $commander,
public Player $player,
) {
}

Expand Down
6 changes: 3 additions & 3 deletions src/Modules/Ares/Domain/Event/Commander/LineChangeEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
use App\Modules\Zeus\Resource\TutorialResource;
use App\Shared\Domain\Event\TutorialEvent;

class LineChangeEvent implements TutorialEvent
readonly class LineChangeEvent implements TutorialEvent
{
public function __construct(
public readonly Commander $commander,
public readonly Player $player,
public Commander $commander,
public Player $player,
) {
}

Expand Down
33 changes: 33 additions & 0 deletions src/Modules/Ares/Domain/Event/Commander/SchoolAssignmentEvent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

declare(strict_types=1);

namespace App\Modules\Ares\Domain\Event\Commander;

use App\Modules\Ares\Model\Commander;
use App\Shared\Domain\Event\TrackingEvent;

readonly class SchoolAssignmentEvent implements TrackingEvent
{
public function __construct(public Commander $commander)
{
}

public function getTrackingPeopleId(): int
{
return $this->commander->player->id;
}

public function getTrackingEventName(): string
{
return 'School Assignment';
}

public function getTrackingData(): array
{
return [
'commander_id' => $this->commander->id,
'base_id' => $this->commander->base->id,
];
}
}
41 changes: 41 additions & 0 deletions src/Modules/Ares/Domain/Event/Fleet/CancelledJourneyEvent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

declare(strict_types=1);

namespace App\Modules\Ares\Domain\Event\Fleet;

use App\Modules\Ares\Domain\Model\CommanderMission;
use App\Modules\Ares\Model\Commander;
use App\Shared\Domain\Event\TrackingEvent;

readonly class CancelledJourneyEvent implements TrackingEvent
{
public function __construct(
public Commander $commander,
public CommanderMission $mission,
) {
}


public function getTrackingPeopleId(): int
{
return $this->commander->player->id;
}

public function getTrackingEventName(): string
{
return 'Cancelled Journey';
}

public function getTrackingData(): array
{
return [
'commander_id' => $this->commander->id,
'mission_type' => $this->mission->value,
'start_place_id' => $this->commander->startPlace->id,
'destination_place_id' => $this->commander->destinationPlace->id,
'start_place_faction_identifier' => $this->commander->startPlace->base?->player->faction->identifier,
'destination_place_faction_identifier' => $this->commander->destinationPlace->base?->player->faction->identifier,
];
}
}
10 changes: 5 additions & 5 deletions src/Modules/Ares/Domain/Event/Fleet/LootEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
use App\Modules\Zeus\Model\Player;
use App\Shared\Domain\Event\TrackingEvent;

class LootEvent implements TrackingEvent
readonly class LootEvent implements TrackingEvent
{
public function __construct(
public readonly Commander $commander,
public readonly Player|null $defender,
public Commander $commander,
public Player|null $defender,
) {
}

Expand All @@ -28,8 +28,8 @@ public function getTrackingData(): array
{
return [
'commander_id' => $this->commander->id,
'origin_place_id' => $this->commander->startPlace,
'target_place_id' => $this->commander->destinationPlace,
'origin_place_id' => $this->commander->startPlace->id,
'target_place_id' => $this->commander->destinationPlace->id,
'is_victorious' => $this->commander->isVictorious(),
'resources' => $this->commander->resources,
'defender_id' => $this->defender?->id,
Expand Down
52 changes: 52 additions & 0 deletions src/Modules/Ares/Domain/Event/Fleet/PlannedColonizationEvent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php

namespace App\Modules\Ares\Domain\Event\Fleet;

use App\Modules\Ares\Model\Commander;
use App\Modules\Gaia\Model\Place;
use App\Modules\Zeus\Model\Player;
use App\Modules\Zeus\Resource\TutorialResource;
use App\Shared\Domain\Event\TrackingEvent;
use App\Shared\Domain\Event\TutorialEvent;

readonly class PlannedColonizationEvent implements TutorialEvent, TrackingEvent
{
public function __construct(
public Place $place,
public Commander $commander,
public Player $attacker,
) {
}

public function getTutorialPlayer(): Player
{
return $this->attacker;
}

public function getTutorialStep(): int|null
{
return TutorialResource::LOOT_PLANET;
}

public function getTrackingPeopleId(): int
{
return $this->attacker->id;
}

public function getTrackingEventName(): string
{
return 'Planned Loot Mission';
}

public function getTrackingData(): array
{
return [
'start_place_id' => $this->commander->startPlace,
'start_place_faction_identifier' => $this->commander->startPlace->base?->player->faction->identifier,
'destination_place_id' => $this->commander->destinationPlace,
'destination_place_player_id' => $this->commander->destinationPlace->base?->player->id,
'destination_place_faction_identifier' => $this->commander->destinationPlace->base?->player->faction->identifier,
'commander_id' => $this->commander->id,
];
}
}
53 changes: 53 additions & 0 deletions src/Modules/Ares/Domain/Event/Fleet/PlannedConquestEvent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php

namespace App\Modules\Ares\Domain\Event\Fleet;

use App\Modules\Ares\Model\Commander;
use App\Modules\Athena\Model\OrbitalBase;
use App\Modules\Gaia\Model\Place;
use App\Modules\Zeus\Model\Player;
use App\Modules\Zeus\Resource\TutorialResource;
use App\Shared\Domain\Event\TrackingEvent;
use App\Shared\Domain\Event\TutorialEvent;

readonly class PlannedConquestEvent implements TutorialEvent, TrackingEvent
{
public function __construct(
public OrbitalBase $base,
public Commander $commander,
public Player $attacker,
) {
}

public function getTutorialPlayer(): Player
{
return $this->attacker;
}

public function getTutorialStep(): int|null
{
return TutorialResource::LOOT_PLANET;
}

public function getTrackingPeopleId(): int
{
return $this->attacker->id;
}

public function getTrackingEventName(): string
{
return 'Planned Loot Mission';
}

public function getTrackingData(): array
{
return [
'start_place_id' => $this->commander->startPlace,
'start_place_faction_identifier' => $this->commander->startPlace->base?->player->faction->identifier,
'destination_place_id' => $this->commander->destinationPlace,
'destination_place_player_id' => $this->commander->destinationPlace->base?->player->id,
'destination_place_faction_identifier' => $this->commander->destinationPlace->base?->player->faction->identifier,
'commander_id' => $this->commander->id,
];
}
}
11 changes: 7 additions & 4 deletions src/Modules/Ares/Domain/Event/Fleet/PlannedLootEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
use App\Shared\Domain\Event\TrackingEvent;
use App\Shared\Domain\Event\TutorialEvent;

class PlannedLootEvent implements TutorialEvent, TrackingEvent
readonly class PlannedLootEvent implements TutorialEvent, TrackingEvent
{
public function __construct(
public readonly Place $place,
public readonly Commander $commander,
public readonly Player $attacker,
public Place $place,
public Commander $commander,
public Player $attacker,
) {
}

Expand Down Expand Up @@ -42,7 +42,10 @@ public function getTrackingData(): array
{
return [
'start_place_id' => $this->commander->startPlace,
'start_place_faction_identifier' => $this->commander->startPlace->base?->player->faction->identifier,
'destination_place_id' => $this->commander->destinationPlace,
'destination_place_player_id' => $this->commander->destinationPlace->base?->player->id,
'destination_place_faction_identifier' => $this->commander->destinationPlace->base?->player->faction->identifier,
'commander_id' => $this->commander->id,
];
}
Expand Down
8 changes: 4 additions & 4 deletions src/Modules/Ares/Domain/Event/Fleet/SquadronUpdateEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
use App\Modules\Zeus\Resource\TutorialResource;
use App\Shared\Domain\Event\TutorialEvent;

class SquadronUpdateEvent implements TutorialEvent
readonly class SquadronUpdateEvent implements TutorialEvent
{
public function __construct(
public readonly Commander $commander,
public readonly Squadron $squadron,
public readonly Player $player,
public Commander $commander,
public Squadron $squadron,
public Player $player,
) {
}

Expand Down
Loading