Debian Codegraph @

src/jj1/jj1episodeutils.cpp

raw symbols SCIP
1
2 /**
3 *
4 * @file jj1episodeutils.cpp
5 *
6 * Part of the OpenJazz project
7 *
8 * @par Licence:
9 * Copyright (c) 2015-2026 Carsten Teibes
10 *
11 * OpenJazz is distributed under the terms of
12 * the GNU General Public License, version 2.0
13 *
14 */
15
16 #include "jj1episodeutils.h"cxx . . $ `<file>/src/jj1/jj1episodeutils.h`/
17 #include "io/log.h"cxx . . $ `<file>/src/io/log.h`/
18
19 int episodeToWorldcxx . . $ episodeToWorld(7864480464b09eea). (int episode) {
20 if(episode < 0 || episode > 9) {
21 LOG_WARNcxx . . $ `src/io/log.h:77:9`!("Invalid Episode");
22
23 return 0;
24 }
25
26 // 1-6
27 if (episode < 6)
28 return episode * 3;
29
30 // A-C
31 if (episode < 9)
32 return (episode + 4) * 3;
33
34 // X
35 return 50;
36 }
37
38
39 int worldToEpisodecxx . . $ worldToEpisode(7864480464b09eea). (int world) {
40 if(world < 0 || world > 50) {
41 LOG_WARNcxx . . $ `src/io/log.h:77:9`!("Invalid World");
42
43 return 0;
44 }
45
46 // X
47 if (world == 50)
48 return 9;
49
50 int episode = world / 3;
51
52 // A-C
53 if (episode > 8)
54 return episode - 4;
55
56 // 1-6
57 return episode;
58 }
59
60 const char *episodeTagcxx . . $ episodeTag(f7ae7e56280f18ae). (int episode) {
61 constexpr const char* episodeTag[10] = { "1", "2", "3", "4", "5", "6",
62 "a", "b", "c", "x" };
63
64 if(episode < 0 || episode > 9) {
65 LOG_WARNcxx . . $ `src/io/log.h:77:9`!("Invalid Episode");
66
67 return " ";
68 }
69
70 return episodeTag[episode];
71 }
72
73 const char *episodeTitlecxx . . $ episodeTitle(f7ae7e56280f18ae). (int episode) {
74 constexpr const char *episodeTitle[10] = { "turtle terror", "ballistic bunny",
75 "rabbits revenge", "gene machine", "the chase is on", "the final clash",
76 "outta dis world", "turtle soup", "wild wabbit", "holiday hare" };
77
78 if(episode < 0 || episode > 9) {
79 LOG_WARNcxx . . $ `src/io/log.h:77:9`!("Invalid Episode");
80
81 return " ";
82 }
83
84 return episodeTitle[episode];
85 }