Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
34fbd4d
Update Rank constants class to use common trait
LartTyler Feb 12, 2020
1dc41bb
Begin adding quest entities
LartTyler Feb 12, 2020
b84f56d
Finish quest entities
LartTyler Feb 12, 2020
47bafcf
Add quest controller and endpoints
LartTyler Feb 12, 2020
5e478ec
Remove unused files
LartTyler Feb 12, 2020
e1afb9f
Add delivery quests
LartTyler Feb 13, 2020
7645ccf
Clean up quest subclasses
LartTyler Feb 13, 2020
71a8477
Fix delivery quest subclassing
LartTyler Feb 13, 2020
4a0bd7b
Add missing column annotation on quest type
LartTyler Feb 13, 2020
175f331
Remove unnecessary null check
LartTyler Feb 13, 2020
e4d1f9f
Remove non-extant imports
LartTyler Feb 13, 2020
7aefc0c
Require description when creating a quest
LartTyler Feb 13, 2020
febceda
Fix incorrect column type
LartTyler Feb 14, 2020
d1f6547
Clean up gitignore
LartTyler Feb 14, 2020
3a554c2
Add transformer and endpoints for endemic life
LartTyler Feb 14, 2020
2a7d5ad
Require description required when creating new endemic life
LartTyler Feb 14, 2020
3a65861
Fix object normalization
LartTyler Feb 14, 2020
d676b1a
Location should not be unique in endemic life locations
LartTyler Feb 14, 2020
73453a1
Cascade delivery quest targets
LartTyler Feb 14, 2020
a522c40
Fix return type
LartTyler Feb 14, 2020
1b13e39
Add missing column definition
LartTyler Feb 14, 2020
197c919
Update migration
LartTyler Feb 14, 2020
1885561
Rework quests to fully support normal search patterns
LartTyler Feb 14, 2020
f315973
Begin adding quest reward support
LartTyler Mar 2, 2020
1d29d19
Install Symfony CLI during Vagrant bootstrap
LartTyler Apr 9, 2020
b18714a
Add support for quest rewards to quest transformer
LartTyler Apr 9, 2020
2c81d74
Update quest and event endpoints to include references to the other
LartTyler Apr 9, 2020
3033882
Add quest support to world event parser
LartTyler Apr 10, 2020
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
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/.idea
# Vagrant files
/.vagrant
/*-cloudimg-console.log

# Data Repo
/data
# IDE Files
/.idea

###> symfony/framework-bundle ###
.env
Expand All @@ -13,4 +13,4 @@
###< symfony/framework-bundle ###
###> lexik/jwt-authentication-bundle ###
/config/jwt/*.pem
###< lexik/jwt-authentication-bundle ###
###< lexik/jwt-authentication-bundle ###
3 changes: 3 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ Vagrant.configure("2") do |config|
echo '[Assertion]' > /etc/php/7.3/cli/conf.d/99-assert.ini
echo 'zend.assertions = 1' >> /etc/php/7.3/cli/conf.d/99-assert.ini
echo 'assert.exception = On' >> /etc/php/7.3/cli/conf.d/99-assert.ini

wget https://get.symfony.com/cli/installer -O /root/installer.sh && bash /root/installer.sh
mv /root/.symfony/bin/symfony /usr/local/bin/symfony
SHELL

config.vm.provision "install", type: "shell", privileged: false, inline: <<-SHELL
Expand Down
2 changes: 2 additions & 0 deletions config/services/contrib.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ services:
App\Contrib\Transformers\ArmorSetBonusTransformer: ~
App\Contrib\Transformers\CharmTransformer: ~
App\Contrib\Transformers\DecorationTransformer: ~
App\Contrib\Transformers\EndemicLifeTransformer: ~
App\Contrib\Transformers\ItemTransformer: ~
App\Contrib\Transformers\LocationTransformer: ~
App\Contrib\Transformers\MonsterTransformer: ~
App\Contrib\Transformers\MotionValueTransformer: ~
App\Contrib\Transformers\QuestTransformer: ~
App\Contrib\Transformers\SkillTransformer: ~
App\Contrib\Transformers\UserTransformer: ~
App\Contrib\Transformers\WeaponTransformer: ~
Expand Down
6 changes: 2 additions & 4 deletions src/Command/WorldEventSyncCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ public function __construct(WorldEventReader $eventReader, EntityManagerInterfac
protected function configure(): void {
$this
->addArgument('platform', InputArgument::REQUIRED)
->addArgument('expansion', InputArgument::OPTIONAL, '', Expansion::BASE)
->addOption('sleep', null, InputOption::VALUE_REQUIRED, '', 5);
->addArgument('expansion', InputArgument::OPTIONAL, '', Expansion::BASE);
}

/**
Expand All @@ -55,8 +54,7 @@ protected function configure(): void {
protected function execute(InputInterface $input, OutputInterface $output): int {
$events = $this->eventReader->read(
$input->getArgument('platform'),
$input->getArgument('expansion'),
(int)$input->getOption('sleep')
$input->getArgument('expansion')
);

$added = 0;
Expand Down
76 changes: 76 additions & 0 deletions src/Contrib/Transformers/EndemicLifeTransformer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?php
namespace App\Contrib\Transformers;

use App\Entity\EndemicLife;
use App\Entity\Location;
use App\Entity\Strings\EndemicLifeStrings;
use App\Localization\L10nUtil;
use App\Utility\ObjectUtil;
use DaybreakStudios\Utility\DoctrineEntities\EntityInterface;
use DaybreakStudios\Utility\EntityTransformers\Exceptions\ValidationException;

class EndemicLifeTransformer extends BaseTransformer {
/**
* {@inheritdoc}
*/
public function doCreate(object $data): EntityInterface {
$missing = ObjectUtil::getMissingProperties(
$data,
[
'name',
'description',
'type',
'researchPointValue',
]
);

if ($missing)
throw ValidationException::missingFields($missing);

return new EndemicLife($data->type, $data->researchPointValue);
}

/**
* {@inheritdoc}
*/
public function doUpdate(EntityInterface $entity, object $data): void {
assert($entity instanceof EndemicLife);

if (ObjectUtil::isset($data, 'name'))
$this->getStrings($entity)->setName($data->name);

if (ObjectUtil::isset($data, 'description'))
$this->getStrings($entity)->setDescription($data->description);

if (ObjectUtil::isset($data, 'type'))
$entity->setType($data->type);

if (ObjectUtil::isset($data, 'researchPointValue'))
$entity->setResearchPointValue($data->researchPointValue);

if (ObjectUtil::isset($data, 'spawnConditions'))
$entity->setSpawnConditions($data->spawnConditions);

if (ObjectUtil::isset($data, 'locations'))
$this->populateFromIdArray('locations', $entity->getLocations(), Location::class, $data->locations);
}

/**
* {@inheritdoc}
*/
public function doDelete(EntityInterface $entity): void {
// TODO: Implement doDelete() method.
}

/**
* @param EndemicLife $endemicLife
*
* @return EndemicLifeStrings
*/
protected function getStrings(EndemicLife $endemicLife): EndemicLifeStrings {
$strings = L10nUtil::findOrCreateStrings($this->getCurrentLocale(), $endemicLife);
assert($strings instanceof EndemicLifeStrings);

return $strings;
}
}
Loading