Skip to content

Commit

Permalink
Write all files (except rules) using ostream (#148)
Browse files Browse the repository at this point in the history
This changes the code to use generic ostreams to write reports
as well as game output files.  The wrap/indent/logic which used
to be part of Areport is now written as a streambuf interceptor
which inserts itself into the streams that want it.   This will
allow us to (as we go farther) to use stringstreams for testing
so that we can compare/check output in test suites.

This does not *yet* modify the rules generation, nor does it
*yet* support json output for reports (and templates) but that
will be coming soon.

The snapshot tests were modified (before my code changes) to
generate one turn with map output to make sure my changes did not
break those formats either.
  • Loading branch information
jt-traub authored Oct 18, 2023
1 parent c15f958 commit 18ffdd3
Show file tree
Hide file tree
Showing 38 changed files with 983 additions and 980 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ ENGINE_OBJECTS = alist.o aregion.o army.o astring.o battle.o economy.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 \
events.o events-battle.o events-assassination.o mapgen.o simplex.o namegen.o
events.o events-battle.o events-assassination.o mapgen.o simplex.o namegen.o \
indenter.o

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

0 comments on commit 18ffdd3

Please sign in to comment.