Skip to content

Commit

Permalink
Write the text reports from json (#161)
Browse files Browse the repository at this point in the history
Rather than writing the text reports and the json reports from the
internal structures, this changes the code to build the json reports
once, and then use that to output both the json report (just dump
the json) and the text reports (utilize the json data to output the
existing textual report format).

This does change one small thing which is that now the templates
are written within the WriteReports function rather than via a
second pass.  Since the Json already contains the unit order info,
this was the cleanest way to do it.   This requires updating the
snapshots of the turn run output since the lines about writing
templates are now gone.
  • Loading branch information
jt-traub authored Dec 12, 2023
1 parent 2ad1047 commit f06bbd1
Show file tree
Hide file tree
Showing 48 changed files with 1,033 additions and 1,843 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ ENGINE_OBJECTS = alist.o aregion.o army.o astring.o battle.o economy.o \
edit.o faction.o game.o gamedata.o gamedefs.o gameio.o \
genrules.o i_rand.o items.o main.o market.o modify.o monthorders.o \
npc.o object.o orders.o parseorders.o production.o quests.o runorders.o \
shields.o skills.o skillshows.o specials.o spells.o template.o unit.o \
shields.o skills.o skillshows.o specials.o spells.o unit.o \
events.o events-battle.o events-assassination.o mapgen.o simplex.o namegen.o \
indenter.o
indenter.o text_report_generator.o

UNITTEST_SRC = unittest/main.cpp unittest/testhelper.cpp $(wildcard unittest/*_test.cpp)
UNITTEST_OBJECTS = $(patsubst unittest/%.cpp,unittest/obj/%.o,$(UNITTEST_SRC))
Expand Down
Loading

0 comments on commit f06bbd1

Please sign in to comment.