From fa00b957378a393f8edbfc98ef111d35d18ecb09 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sun, 24 Sep 2023 13:40:25 +0200 Subject: initial commit --- views/base.twig | 26 +++++++ views/components/timer.twig | 25 +++++++ views/root.twig | 10 +++ views/village.twig | 169 ++++++++++++++++++++++++++++++++++++++++++++ views/villages.twig | 38 ++++++++++ 5 files changed, 268 insertions(+) create mode 100644 views/base.twig create mode 100644 views/components/timer.twig create mode 100644 views/root.twig create mode 100644 views/village.twig create mode 100644 views/villages.twig (limited to 'views') diff --git a/views/base.twig b/views/base.twig new file mode 100644 index 0000000..94e5037 --- /dev/null +++ b/views/base.twig @@ -0,0 +1,26 @@ +{% extends 'root.twig' %} + +{% block body %} +
+
+ +
+ {% block main %}{% endblock %} +
+ +
+ +
+ +
+{% endblock %} diff --git a/views/components/timer.twig b/views/components/timer.twig new file mode 100644 index 0000000..97977da --- /dev/null +++ b/views/components/timer.twig @@ -0,0 +1,25 @@ + + + + diff --git a/views/root.twig b/views/root.twig new file mode 100644 index 0000000..11dc665 --- /dev/null +++ b/views/root.twig @@ -0,0 +1,10 @@ + + + + + + + + {% block body %}{% endblock %} + + diff --git a/views/village.twig b/views/village.twig new file mode 100644 index 0000000..7bb55b2 --- /dev/null +++ b/views/village.twig @@ -0,0 +1,169 @@ +{% extends 'base.twig' %} + +{% block main %} +
+ +
+
{{ village.x }} x {{ village.y }} — {{ village.name }}
+ +
+ wood: {{ village.wood }} / {{ village.getStorage(village.id).getResourceCapacity('wood') }} – {{ village.getBuilding(village.id, 'WoodCutter').getResourceIncrementor() }} + clay: {{ village.clay }} / {{ village.getStorage(village.id).getResourceCapacity('clay') }} – {{ village.getBuilding(village.id, 'ClayPit').getResourceIncrementor() }} + iron: {{ village.iron }} / {{ village.getStorage(village.id).getResourceCapacity('iron') }} – {{ village.getBuilding(village.id, 'IronMine').getResourceIncrementor() }} + food: {{ village.food }} / {{ village.getStorage(village.id).getResourceCapacity('food') }} – {{ village.getBuilding(village.id, 'Farm').getResourceIncrementor() }} + + capacity: {{ village.getStorage(village.id).getCapacity() }} +
+
+ +
+

Events

+ + {% if events['UpgradeBuilding'] %} +

Upgrade Buildings

+ + + + + + + + + + {% for event in events['UpgradeBuilding'] %} + + + + + + {% endfor %} + +
BuildingTime
{{ event.data.building }} + {% include 'components/timer.twig' with { 'time': event.event.time|date('c') } %} + + + Cancel + +
+ {% endif %} + + {% if events.train %} +

Train Units

+ {% endif %} + + {% if events.send %} +

Send Resources / Units

+ {% endif %} +
+ +
+
+

Buildings

+ + + + + + + + + + + + {% for building in village.getBuildings(village.id) %} + + + + + + + + {% endfor %} + +
TypeLevelBuild TimeResources
{{ building.type }}{{ building.level }}{{ building.getBuildTime() | buildTime }} + wood: {{ building.getResourceRequirements()['wood'] }} +   + clay: {{ building.getResourceRequirements()['clay'] }} +   + iron: {{ building.getResourceRequirements()['iron'] }} + +
+ +
+
+
+ +
+

Units

+ + + + + + + + + + + + {% for unit in village.getUnits(village.id, 1) %} + + + + + + + + {% endfor %} + +
TypeAmountBuild TimeResources
{{ unit.type }}{{ unit.amount }} + {{ unit.getBuildTime(1) | buildTime }} + + wood: {{ unit.getResourceRequirements()['wood'] }} +   + clay: {{ unit.getResourceRequirements()['clay'] }} +   + iron: {{ unit.getResourceRequirements()['iron'] }} +   + food: {{ unit.getResourceRequirements()['food'] ?? 0 }} + +
+ + +
+
+ +

Supporting Units

+ + + + + + + + + + + + {% for unit in village.getUnits(village.id, 2) | merge(village.getUnits(village.id, 3)) %} + + + + + + + + {% endfor %} + +
TypeAmountOriginLocation
{{ unit.type }}{{ unit.amount }}{{ village.get(unit.homeVillageId).name }}{{ not unit.isTraveling ? village.get(unit.residenceVillageId).name : '~traveling~' }} + {% if not unit.isTraveling %} +
+ + +
+ {% endif %} +
+
+
+
+{% endblock %} diff --git a/views/villages.twig b/views/villages.twig new file mode 100644 index 0000000..21d8cec --- /dev/null +++ b/views/villages.twig @@ -0,0 +1,38 @@ +{% extends 'base.twig' %} + +{% block main %} + + + + + + + + + + + + + + + {% for village in villages %} + + + + + + + + + + + {% endfor %} + +
NameCoordinatesWoodClayIronFoodStorageReputation
+ + {{ village.name }} + + + { x: {{ village.x }}, y: {{ village.y }} } + {{ village.wood }}{{ village.clay }}{{ village.iron }}{{ village.food }}{{ village.getStorage(village.id).getCapacity() * (25 / 100) }}{{ village.reputation }}
+{% endblock %} -- cgit v1.2.3