summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-01-02 20:42:01 +0100
committerDaniel Weipert <git@mail.dweipert.de>2024-01-05 12:33:59 +0100
commitb21316248572cb27ed1f504529ad6680a473022e (patch)
treef8a2f81258cae3b1d2429fb7df5a3287954b683a /views
parentf621d95f89ded05a2e916c5ee363bfe75ea37482 (diff)
gemini
Diffstat (limited to 'views')
-rw-r--r--views/gemini/error.twig3
-rw-r--r--views/gemini/storage.twig16
-rw-r--r--views/gemini/village.twig136
-rw-r--r--views/gemini/villages.twig3
-rw-r--r--views/http/base.twig (renamed from views/base.twig)0
-rw-r--r--views/http/components/timer.twig (renamed from views/components/timer.twig)0
-rw-r--r--views/http/error.twig (renamed from views/error.twig)0
-rw-r--r--views/http/login.twig (renamed from views/login.twig)2
-rw-r--r--views/http/map.twig (renamed from views/map.twig)0
-rw-r--r--views/http/root.twig (renamed from views/root.twig)0
-rw-r--r--views/http/village.twig (renamed from views/village.twig)0
-rw-r--r--views/http/villages.twig (renamed from views/villages.twig)0
12 files changed, 159 insertions, 1 deletions
diff --git a/views/gemini/error.twig b/views/gemini/error.twig
new file mode 100644
index 0000000..67aff6a
--- /dev/null
+++ b/views/gemini/error.twig
@@ -0,0 +1,3 @@
+=> /villages Overview
+
+Error: {{ message }}
diff --git a/views/gemini/storage.twig b/views/gemini/storage.twig
new file mode 100644
index 0000000..c9ecd4f
--- /dev/null
+++ b/views/gemini/storage.twig
@@ -0,0 +1,16 @@
+=> /village/{{ village.x }}/{{ village.y }} Back
+
+# Configure Storage
+
+=> /village/{{ village.x }}/{{ village.y }}/storage/config/wood {{ village.getStorageConfig(village.id).wood }}% Wood
+=> /village/{{ village.x }}/{{ village.y }}/storage/config/clay {{ village.getStorageConfig(village.id).clay }}% Clay
+=> /village/{{ village.x }}/{{ village.y }}/storage/config/iron {{ village.getStorageConfig(village.id).iron }}% Iron
+=> /village/{{ village.x }}/{{ village.y }}/storage/config/food {{ village.getStorageConfig(village.id).food }}% Food
+
+# Resources
+
+Wood: {{ village.wood }} / {{ village.getStorage(village.id).getResourceCapacity('wood') }} - Increment: {{ village.getBuilding(village.id, 'WoodCutter').getResourceIncrementor() }}
+Clay: {{ village.clay }} / {{ village.getStorage(village.id).getResourceCapacity('clay') }} - Increment: {{ village.getBuilding(village.id, 'ClayPit').getResourceIncrementor() }}
+Iron: {{ village.iron }} / {{ village.getStorage(village.id).getResourceCapacity('iron') }} - Increment: {{ village.getBuilding(village.id, 'IronMine').getResourceIncrementor() }}
+Food: {{ village.food }} / {{ village.getStorage(village.id).getResourceCapacity('food') }} - Increment: {{ village.getBuilding(village.id, 'Farm').getResourceIncrementor() }}
+Storage Capacity: {{ village.getStorage(village.id).getCapacity() }}
diff --git a/views/gemini/village.twig b/views/gemini/village.twig
new file mode 100644
index 0000000..199f53a
--- /dev/null
+++ b/views/gemini/village.twig
@@ -0,0 +1,136 @@
+=> /villages Overview
+
+
+# {{ village.name }} - {{ village.x }} x {{ village.y }}
+=> /map/{{ village.x }}/{{ village.y }} Map - {{ village.x }} x {{ village.y }}
+Satisfaction: {{ village.satisfaction }}
+
+
+# Resources
+
+Wood: {{ village.wood }} / {{ village.getStorage(village.id).getResourceCapacity('wood') }} - Increment: {{ village.getBuilding(village.id, 'WoodCutter').getResourceIncrementor() }}
+Clay: {{ village.clay }} / {{ village.getStorage(village.id).getResourceCapacity('clay') }} - Increment: {{ village.getBuilding(village.id, 'ClayPit').getResourceIncrementor() }}
+Iron: {{ village.iron }} / {{ village.getStorage(village.id).getResourceCapacity('iron') }} - Increment: {{ village.getBuilding(village.id, 'IronMine').getResourceIncrementor() }}
+Food: {{ village.food }} / {{ village.getStorage(village.id).getResourceCapacity('food') }} - Increment: {{ village.getBuilding(village.id, 'Farm').getResourceIncrementor() }}
+Storage Capacity: {{ village.getStorage(village.id).getCapacity() }}
+=> /village/{{ village.x }}/{{ village.y }}/storage/config Configure Storage
+
+
+# Events
+
+{% if events['UpgradeBuilding'] %}
+## Upgrade Building
+{% for typeEvents in events['UpgradeBuilding'] %}
+{% for event in typeEvents %}
+### {{ event.type }}
+Finished: {{ event.event.time | date('c') }}
+=> /village/{{ village.x }}/{{ village.y }}/building/UpgradeBuilding/build/cancel Cancel
+{% endfor %}
+{% endfor %}
+{% endif %}
+
+{% if events['TrainUnits'] %}
+## Train Units
+{% for event in events['TrainUnits'] %}
+### {{ event.type }}
+Amount: {{ event.amount }}
+Finished: {{ event.event.time | date('c') }}
+=> /village/{{ village.x }}/{{ village.y }}/unit/train/cancel Cancel
+{% endfor %}
+{% endif %}
+
+{% if events['SendUnits'] %}
+## Send Units
+{% for event in events['SendUnits'] %}
+### {{ event.unit }} - {{ event.type }}
+Amount: {{ event.amount }}
+Source: {{ village.get(event.source).name }}
+Destination: {{ village.get(event.destination).name }}
+Finished: {{ event.event.time | date('c') }}
+{% if event.isCanceled %}
+Canceled
+{% else %}
+{% if event.event.villageId == village.id %}
+=> /event/{{ event.event.id }}/cancel Cancel
+{% endif %}
+{% endif %}
+{% endfor %}
+{% endif %}
+
+
+# Buildings
+
+{% for building in buildings %}
+## {{ building.type }}
+Level: {{ building.level | default(0) }}
+Build Time: {{ building.getBuildTimeForLevel(building.getEffectiveLevel() + 1) | buildTime }}
+Resources:
+* Wood: {{ building.getResourceRequirementsForLevel(building.getEffectiveLevel() + 1)['wood'] }}
+* Clay: {{ building.getResourceRequirementsForLevel(building.getEffectiveLevel() + 1)['clay'] }}
+* Iron: {{ building.getResourceRequirementsForLevel(building.getEffectiveLevel() + 1)['iron'] }}
+=> /village/{{ village.x }}/{{ village.y }}/building/{{ building.type }}/manage Manage
+{% if village.canBuild(village, building) %}
+=> /village/{{ village.x }}/{{ village.y }}/building/{{ building.type }}/level-up Level up
+{% endif %}
+{% endfor %}
+
+
+# Units At Home
+
+{% for unit in village.getUnits(village.id, 1, 3) %}
+## {{ unit.type }}
+Amount: {{ unit.amount }}
+{% if not unit.isTraveling %}
+Build Time: {{ unit.getBuildTime(1) | buildTime }}
+Resources:
+* Wood: {{ unit.getResourceRequirements(unit, 1)['wood'] }}
+* Clay: {{ unit.getResourceRequirements(unit, 1)['clay'] }}
+* Iron: {{ unit.getResourceRequirements(unit, 1)['iron'] }}
+* Food: {{ unit.getResourceRequirements(unit, 1)['food'] ?? 0 }}
+{% if village.canTrain(village, unit, 1) %}
+=> /village/{{ village.x }}/{{ village.y }}/unit/{{ unit.type }}/create Train
+{% endif %}
+{% else %}
+~traveling~
+{% endif %}
+{% endfor %}
+
+
+# Units Supporting
+
+{% for unit in village.getUnits(village.id, 2) | merge(village.getUnits(village.id, 3)) %}
+## {{ unit.type }}
+Amount: {{ unit.amount }}
+Origin: {{ village.get(unit.homeVillageId).name }}
+Location: {{ not unit.isTraveling ? village.get(unit.residenceVillageId).name : '~traveling~' }}
+Travel Time: {{ unit.getTravelTime(unit, village.getDistance(unit.getHomeVillage().x, unit.getHomeVillage().x, unit.getResidenceVillage().x, unit.getResidenceVillage().y)) | buildTime }}
+{% if not unit.isTraveling %}
+{% if unit.homeVillageId == village.id %}
+=> /village/{{ village.x }}/{{ village.y }}/unit/{{ unit.type }}/location/{{ unit.getResidenceVillage().x }}/{{ unit.getResidenceVillage().y }}/recall Recall Home
+{% else %}
+=> /village/{{ village.x }}/{{ village.y }}/unit/{{ unit.type }}/location/{{ unit.getHomeVillage().x }}/{{ unit.getHomeVillage().y }}/send-back Send Back
+{% endif %}
+{% endif %}
+{% endfor %}
+
+
+# Send Units
+
+TODO
+* list possible units
+* list possible villages
+* send INPUT request for amount
+
+
+# Send Resources
+
+TODO
+* list possible resource types
+* list possible villages
+* send INPUT request for amount
+
+
+Logged in as {{ session.user.username }}
+=> /logout Logout
+
+Server Time: {{ 'now' | date('c') }}
diff --git a/views/gemini/villages.twig b/views/gemini/villages.twig
new file mode 100644
index 0000000..1c8eb82
--- /dev/null
+++ b/views/gemini/villages.twig
@@ -0,0 +1,3 @@
+{% for village in villages %}
+=> /village/{{ village.x }}/{{ village.y }} {{ village.name }}
+{% endfor %}
diff --git a/views/base.twig b/views/http/base.twig
index 15ddafd..15ddafd 100644
--- a/views/base.twig
+++ b/views/http/base.twig
diff --git a/views/components/timer.twig b/views/http/components/timer.twig
index ccb31a7..ccb31a7 100644
--- a/views/components/timer.twig
+++ b/views/http/components/timer.twig
diff --git a/views/error.twig b/views/http/error.twig
index f9d70cd..f9d70cd 100644
--- a/views/error.twig
+++ b/views/http/error.twig
diff --git a/views/login.twig b/views/http/login.twig
index 095f53e..723d5d2 100644
--- a/views/login.twig
+++ b/views/http/login.twig
@@ -5,7 +5,7 @@
<form action="/login" method="post">
<label>
E-Mail:
- <input type="email" name="email">
+ <input type="text" name="email" placeholder="or Username">
</label>
<label>
Password:
diff --git a/views/map.twig b/views/http/map.twig
index 29f0294..29f0294 100644
--- a/views/map.twig
+++ b/views/http/map.twig
diff --git a/views/root.twig b/views/http/root.twig
index 35399c0..35399c0 100644
--- a/views/root.twig
+++ b/views/http/root.twig
diff --git a/views/village.twig b/views/http/village.twig
index c72018c..c72018c 100644
--- a/views/village.twig
+++ b/views/http/village.twig
diff --git a/views/villages.twig b/views/http/villages.twig
index bdb87be..bdb87be 100644
--- a/views/villages.twig
+++ b/views/http/villages.twig