Skip to content

Commit

Permalink
Add language-zh.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
1iuh authored and liuh committed Aug 2, 2024
1 parent 617f125 commit 6683d89
Show file tree
Hide file tree
Showing 5 changed files with 9,229 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile.rv
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ savepng-loc.o: savepng.cpp
hyper-rogueviz.o: hyper.cpp graph.cpp hyperpoint.cpp geometry.cpp cell.cpp heptagon.cpp game.cpp classes.cpp polygons.cpp language.cpp language-data.cpp achievement.cpp shmup.cpp patterns.cpp mapeditor.cpp netgen.cpp yendor.cpp hyper.h rug.cpp flags.cpp system.cpp landgen.cpp orbs.cpp complex.cpp conformal.cpp menus.cpp init.cpp dialogs.cpp sound.cpp util.cpp ${drogueviz} fieldpattern.cpp ${MAIN} control.cpp commandline.cpp
${CXX} ${PROF} ${MAIN} -c -o hyper-rogueviz.o ${MYFLAGS}

langen: langen.cpp language-cz.cpp language-pl.cpp language-tr.cpp language-ru.cpp language-de.cpp language-ptbr.cpp language-fr.cpp
langen: langen.cpp language-cz.cpp language-pl.cpp language-tr.cpp language-ru.cpp language-de.cpp language-ptbr.cpp language-fr.cpp language-zh.cpp
${CXX} langen.cpp -o langen -g

language-data.cpp: langen
Expand Down
Binary file modified NotoSans-Regular.ttf
Binary file not shown.
25 changes: 23 additions & 2 deletions langen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

template<class T> int isize(const T& x) { return x.size(); }

#define NUMLAN 8
#define NUMLAN 9

// language generator

Expand Down Expand Up @@ -290,6 +290,27 @@ void langFR() {
current_language = "-";
}

void langZH() {
current_language = "ZH";
static std::pair<const char *, const char *> ds[] = {
#define S(a,b) { a, b },
#define N(a,b,c)
#include "language-zh.cpp"
#undef N
#undef S
};
static std::pair<const char *, noun2> ns[] = {
#define S(a,b)
#define N(a,b,c) { a, noun2{ b, c, c, c, c } },
#include "language-zh.cpp"
#undef N
#undef S
};
for(auto&& elt : ds) d[8].add(elt.first, elt.second);
for(auto&& elt : ns) nouns[8].add(elt.first, elt.second);
current_language = "-";
}

int completeness[NUMLAN];

template<class T>
Expand Down Expand Up @@ -358,7 +379,7 @@ int main() {

langPL(); langCZ(); langRU();
langTR(); langDE(); langPT();
langFR();
langFR(); langZH();

// verify
compute_completeness(d);
Expand Down
Loading

0 comments on commit 6683d89

Please sign in to comment.