Skip to content

Commit eca166b

Browse files
author
Allen B. Cummings
committed
Merged PR 500: Merge 601_player_castles to master
Related work items: #601
1 parent bf2ff3a commit eca166b

File tree

11 files changed

+372
-108
lines changed

11 files changed

+372
-108
lines changed

dictionaries/domainDictionary.c

Lines changed: 24 additions & 9 deletions
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -177,11 +177,7 @@ private nomask string applyColorToBuilding(mapping component, string key,
177
{
177
{
178
string ret = 0;
178
string ret = 0;
179
string *colors = m_indices(CastleComponents[key]["colors"]);
179
string *colors = m_indices(CastleComponents[key]["colors"]);
180-
colors -= ({ "default" });
180+
181-
182-
printf("component = %O\n", component);
183-
printf("colors = %O\n", colors);
184-
185
if (member(CastleComponents[key]["colors"]["default"], colorConfiguration))
181
if (member(CastleComponents[key]["colors"]["default"], colorConfiguration))
186
{
182
{
187
ret = component[charset];
183
ret = component[charset];
@@ -201,7 +197,8 @@ private nomask string applyColorToBuilding(mapping component, string key,
201
}
197
}
202

198

203
/////////////////////////////////////////////////////////////////////////////
199
/////////////////////////////////////////////////////////////////////////////
204-
public nomask varargs mapping getPlayerDomain(object player, string type)
200+
public nomask varargs mapping getPlayerDomain(object player, string location,
201+
string type)
205
{
202
{
206
mapping ret = ([]);
203
mapping ret = ([]);
207

204

@@ -216,10 +213,8 @@ public nomask varargs mapping getPlayerDomain(object player, string type)
216
foreach(string component in components)
213
foreach(string component in components)
217
{
214
{
218
string key = sprintf("unbuilt %s", component);
215
string key = sprintf("unbuilt %s", component);
219-
printf("key = %O\n", key);
220
foreach(string section in m_indices(CastleComponents[key]["components"]))
216
foreach(string section in m_indices(CastleComponents[key]["components"]))
221
{
217
{
222-
printf("Oink: %O, %O\n\n", section, key);
223
ret["components"][component][section] =
218
ret["components"][component][section] =
224
applyColorToBuilding(
219
applyColorToBuilding(
225
CastleComponents[key]["components"][section] + ([]),
220
CastleComponents[key]["components"][section] + ([]),
@@ -228,7 +223,27 @@ public nomask varargs mapping getPlayerDomain(object player, string type)
228
}
223
}
229
}
224
}
230

225

231-
// do getting of buildings
226+
mapping upgrades = player->getDomainUpgrades(location, type);
227+
if (sizeof(upgrades))
228+
{
229+
foreach(string upgrade in m_indices(upgrades))
230+
{
231+
printf("Oy!\n");
232+
if (member(CastleComponents, upgrades[upgrade]))
233+
{
234+
mapping components =
235+
CastleComponents[upgrades[upgrade]]["components"];
236+
237+
foreach(string section in m_indices(components))
238+
{
239+
ret["components"][upgrade][section] =
240+
applyColorToBuilding(
241+
CastleComponents[upgrades[upgrade]]["components"][section] + ([]),
242+
upgrades[upgrade], colorConfiguration, charset);
243+
}
244+
}
245+
}
246+
}
232

247

233
transformLayout(ret);
248
transformLayout(ret);
234
return ret;
249
return ret;

dictionaries/domains/buildings.h

Lines changed: 85 additions & 0 deletions
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -5,6 +5,91 @@
5
#ifndef buildings_h
5
#ifndef buildings_h
6
#define buildings_h
6
#define buildings_h
7

7

8+
/*
9+
mapping swapstuff = ([
10+
"KEEP 1": "\xe2\x94\x8c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80"
11+
"\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x90",
12+
"KEEP 2": "\xe2\x94\x82\xe2\x96\x91\xe2\x96\x91\xe2\x96\x91"
13+
"\xe2\x96\x91\xe2\x96\x91\xe2\x96\x91\xe2\x96\x91\xe2\x94\x82",
14+
"KEEP 3": "\xe2\x94\x83\xe2\x96\x91\xe2\x96\x91\xe2\x96\x91\xe2\x96\x91\xe2\x96\x91\xe2\x96\x91\xe2\x96\x91\xe2\x94\x83",
15+
"KEEP 4": "\xe2\x94\x83\xe2\x96\x91\xe2\x96\x91\xe2\x96\x91\xe2\x96\x91\xe2\x96\x91\xe2\x96\x91\xe2\x96\x91\xe2\x94\x83",
16+
"KEEP 5": "\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80"
17+
"\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x98",
18+
"MMM": " ",
19+
"NWX": " \xe2\x95\x91",
20+
"NEX": "\xe2\x95\x91 ",
21+
"SWX": " \xe2\x95\x91",
22+
"SEX": "\xe2\x95\x91 ",
23+
"NWI": " \xe2\x95\x91",
24+
"NEI": "\xe2\x95\x91 ",
25+
"WC1": "\xe2\x95\x94\xe2\x95\x90\xe2\x95\x9d",
26+
"WC2": "\xe2\x95\x91 ",
27+
"WC3": "\xe2\x95\x91 ",
28+
"WC4": "\xe2\x95\x91 ",
29+
"WC5": "\xe2\x95\x91 ",
30+
"WC6": "\xe2\x95\x9a\xe2\x95\x90\xe2\x95\x97",
31+
"WM1": "\xe2\x95\x94\xe2\x95\x90\xe2\x95\x9d",
32+
"WM2": "\xe2\x95\x9a\xe2\x95\x90\xe2\x95\x97",
33+
"EM1": "\xe2\x95\x9a\xe2\x95\x90\xe2\x95\x97",
34+
"EM2": "\xe2\x95\x94\xe2\x95\x90\xe2\x95\x9d",
35+
"EC1": "\xe2\x95\x9a\xe2\x95\x90\xe2\x95\x97",
36+
"EC2": " \xe2\x95\x91",
37+
"EC3": " \xe2\x95\x91",
38+
"EC4": " \xe2\x95\x91",
39+
"EC5": " \xe2\x95\x91",
40+
"EC6": "\xe2\x95\x94\xe2\x95\x90\xe2\x95\x9d",
41+
"NWCTR1": "\xe2\x95\x94\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x97",
42+
"NWCTR2": "\xe2\x95\x91 \xe2\x95\x91",
43+
"NWCTR3": "\xe2\x95\x91 \xe2\x95\x91",
44+
"NWCTR4": "\xe2\x95\x9a\xe2\x95\x90\xe2\x95\xa6\xe2\x95\x90\xe2\x95\x90\xe2\x95\x9d",
45+
"NECTR1": "\xe2\x95\x94\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x97",
46+
"NECTR2": "\xe2\x95\x91 \xe2\x95\x91",
47+
"NECTR3": "\xe2\x95\x91 \xe2\x95\x91",
48+
"NECTR4": "\xe2\x95\x9a\xe2\x95\x90\xe2\x95\x90\xe2\x95\xa6\xe2\x95\x90\xe2\x95\x9d",
49+
"NCATOWER1": "\xe2\x95\x94\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x97",
50+
"NCATOWER2": "\xe2\x95\x91 \xe2\x95\x91",
51+
"NCATOWER3": "\xe2\x95\x9a\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x9d",
52+
"NWCASTLEWALL": "\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90",
53+
"NECASTLEWALL": "\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90",
54+
"SWCASTLEWALL": "\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90",
55+
"SECASTLEWALL": "\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90",
56+
"NT1": "\xe2\x95\x94\xe2\x95\x90\xe2\x95\x97",
57+
"NT2": "\xe2\x95\x9d \xe2\x95\x9a",
58+
"NWMWAL": "\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90",
59+
"NEMWAL": "\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90",
60+
"NWMTR1": "\xe2\x95\x94\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x97",
61+
"NWMTR2": "\xe2\x95\x91 \xe2\x95\x9a",
62+
"NWMTR3": "\xe2\x95\x91 ",
63+
"NWMTR4": "\xe2\x95\x9a\xe2\x95\x90\xe2\x95\x97 ",
64+
"NEMTR1": "\xe2\x95\x94\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x97",
65+
"NEMTR2": "\xe2\x95\x9d \xe2\x95\x91",
66+
"NEMTR3": " \xe2\x95\x91",
67+
"NEMTR4": " \xe2\x95\x94\xe2\x95\x90\xe2\x95\x9d",
68+
"SWMWAL": "\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90",
69+
"SEMWAL": "\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90",
70+
"SWMTR1": "\xe2\x95\x94\xe2\x95\x90\xe2\x95\x9d ",
71+
"SWMTR2": "\xe2\x95\x91 ",
72+
"SWMTR3": "\xe2\x95\x91 \xe2\x95\x94",
73+
"SWMTR4": "\xe2\x95\x9a\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x9d",
74+
"SEMTR1": " \xe2\x95\x9a\xe2\x95\x90\xe2\x95\x97",
75+
"SEMTR2": " \xe2\x95\x91",
76+
"SEMTR3": "\xe2\x95\x97 \xe2\x95\x91",
77+
"SEMTR4": "\xe2\x95\x9a\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x9d",
78+
"ST1": "\xe2\x95\x97 \xe2\x95\x94",
79+
"ST2": "\xe2\x95\x9a\xe2\x95\x90\xe2\x95\x9d",
80+
"SWCTR1": "\xe2\x95\x94\xe2\x95\x90\xe2\x95\xa9\xe2\x95\x90\xe2\x95\x90\xe2\x95\x97",
81+
"SWCTR2": "\xe2\x95\x91 \xe2\x95\x91",
82+
"SWCTR3": "\xe2\x95\x91 \xe2\x95\x91",
83+
"SWCTR4": "\xe2\x95\x9a\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x9d",
84+
"SECTR1": "\xe2\x95\x94\xe2\x95\x90\xe2\x95\x90\xe2\x95\xa9\xe2\x95\x90\xe2\x95\x97",
85+
"SECTR2": "\xe2\x95\x91 \xe2\x95\x91",
86+
"SECTR3": "\xe2\x95\x91 \xe2\x95\x91",
87+
"SECTR4": "\xe2\x95\x9a\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x9d",
88+
"SCATOWER1": "\xe2\x95\x94\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x97",
89+
"SCATOWER2": "\xe2\x95\x91 \xe2\x95\x91",
90+
"SCATOWER3": "\xe2\x95\x9a\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x9d",
91+
92+
]);*/
8
private mapping BuildingBlueprints = ([
93
private mapping BuildingBlueprints = ([
9
"unbuilt keep":([
94
"unbuilt keep":([
10
"type": "keep",
95
"type": "keep",

0 commit comments

Comments
 (0)