Description:
Cleanup.
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
@@ -35,7 +35,7 | |||||
|
35 | private Grammar grammar; |
|
35 | private Grammar grammar; |
|
36 |
|
36 | ||
|
37 |
|
37 | ||
|
38 |
public ContractSpawner(int mapWidth, int mapHeight, Simulation simulation, Grammar grammar) |
|
38 | public ContractSpawner(int mapWidth, int mapHeight, Simulation simulation, Grammar grammar) |
|
39 | { |
|
39 | { |
|
40 | this.random_generator = new Random(); |
|
40 | this.random_generator = new Random(); |
|
41 |
|
41 | ||
@@ -164,7 +164,7 | |||||
|
164 | CreateArea(start_x, start_y, max_squares, new HashSet<Vector2>(occupied)) : message.squares; |
|
164 | CreateArea(start_x, start_y, max_squares, new HashSet<Vector2>(occupied)) : message.squares; |
|
165 | if(i > 0) |
|
165 | if(i > 0) |
|
166 | { |
|
166 | { |
|
167 |
Logging.Info(String.Format("Creating area using a {0} chance didn't work |
|
167 | Logging.Info(String.Format("Creating area using a {0} chance didn't work; using {1}.", odds_to_try[i-1], odds_to_try[i])); |
|
168 | } |
|
168 | } |
|
169 |
|
169 | ||
|
170 | if (retry_location[i]) |
|
170 | if (retry_location[i]) |
@@ -175,7 +175,7 | |||||
|
175 |
|
175 | ||
|
176 | start_x = (int)start.X; |
|
176 | start_x = (int)start.X; |
|
177 | start_y = (int)start.Y; |
|
177 | start_y = (int)start.Y; |
|
178 |
Logging.Info(String.Format("Creating area using original location ({0}, {1}) didn't work |
|
178 | Logging.Info(String.Format("Creating area using original location ({0}, {1}) didn't work; trying a new one ({2} {3}).", |
|
179 | old_start_x, old_start_y, start_x, start_y)); |
|
179 | old_start_x, old_start_y, start_x, start_y)); |
|
180 | } |
|
180 | } |
|
181 |
|
181 | ||
@@ -227,7 +227,7 | |||||
|
227 | } |
|
227 | } |
|
228 | } |
|
228 | } |
|
229 |
|
229 | ||
|
230 | Logging.Warning("Never generated enough squares for area."); |
|
230 | Logging.Warning(string.Format("Never generated enough squares for area (requested {0}).", max_squares)); |
|
231 |
|
231 | ||
|
232 | } |
|
232 | } |
|
233 | } |
|
233 | } |
@@ -17,12 +17,11 | |||||
|
17 | [Reads(typeof(WindowTypeComponent), |
|
17 | [Reads(typeof(WindowTypeComponent), |
|
18 | typeof(VisibilityComponent), |
|
18 | typeof(VisibilityComponent), |
|
19 | typeof(SelectedComponent))] |
|
19 | typeof(SelectedComponent))] |
|
20 |
[Writes(typeof(VisibilityComponent), |
|
20 | [Writes(typeof(VisibilityComponent), |
|
21 | typeof(SelectedComponent), |
|
21 | typeof(SelectedComponent), |
|
22 | typeof(DialogComponent))] |
|
22 | typeof(DialogComponent))] |
|
23 | class UIEngine : Engine |
|
23 | class UIEngine : Engine |
|
24 | { |
|
24 | { |
|
25 |
|
|||
|
26 | public override void Update(double dt) |
|
25 | public override void Update(double dt) |
|
27 | { |
|
26 | { |
|
28 | foreach (var entity in ReadEntities<SelectedComponent>()) |
|
27 | foreach (var entity in ReadEntities<SelectedComponent>()) |
@@ -32,26 +31,17 | |||||
|
32 |
|
31 | ||
|
33 | foreach (ref readonly var windowMessage in ReadMessages<SetWindowVisibilityMessage>()) |
|
32 | foreach (ref readonly var windowMessage in ReadMessages<SetWindowVisibilityMessage>()) |
|
34 | { |
|
33 | { |
|
35 | //Logging.Spy(windowMessage, "message"); |
|
||
|
36 | //Logging.Spy(windowMessage.Entity, "message.Entity"); |
|
||
|
37 | //Logging.Spy(windowMessage.Entity.ID, "message.Entity.ID"); |
|
||
|
38 | //Logging.Spy(windowMessage.Visibility, "message.Visibility"); |
|
||
|
39 | foreach (ref readonly var entity in ReadEntities<WindowTypeComponent>()) |
|
34 | foreach (ref readonly var entity in ReadEntities<WindowTypeComponent>()) |
|
40 | { |
|
35 | { |
|
41 | //Logging.Spy(entity.ID, "ID"); |
|
||
|
42 | if (EntityExists(windowMessage.Entity) && entity.ID == windowMessage.Entity.ID) |
|
36 | if (EntityExists(windowMessage.Entity) && entity.ID == windowMessage.Entity.ID) |
|
43 | { |
|
37 | { |
|
44 | SetComponent(entity, new VisibilityComponent { visible = windowMessage.Visibility }); |
|
38 | SetComponent(entity, new VisibilityComponent { visible = windowMessage.Visibility }); |
|
45 | Logging.Success("Set Visibility."); |
|
39 | Logging.Success("Set Visibility."); |
|
46 |
|
|||
|
47 | } |
|
40 | } |
|
48 | } |
|
41 | } |
|
49 | } |
|
42 | } |
|
50 | foreach (ref readonly var windowMessage in ReadMessages<ToggleWindowMessage>()) |
|
43 | foreach (ref readonly var windowMessage in ReadMessages<ToggleWindowMessage>()) |
|
51 | { |
|
44 | { |
|
52 | //Logging.Spy(windowMessage, "message"); |
|
||
|
53 | //Logging.Spy(windowMessage.Window, "message.Window"); |
|
||
|
54 | //Logging.Spy(windowMessage.Entity, "message.Entity"); |
|
||
|
55 | foreach (ref readonly var entity in ReadEntities<WindowTypeComponent>()) |
|
45 | foreach (ref readonly var entity in ReadEntities<WindowTypeComponent>()) |
|
56 | { |
|
46 | { |
|
57 | if (EntityExists(windowMessage.Entity) && entity.ID == windowMessage.Entity.ID) |
|
47 | if (EntityExists(windowMessage.Entity) && entity.ID == windowMessage.Entity.ID) |
@@ -64,11 +54,8 | |||||
|
64 | } |
|
54 | } |
|
65 | foreach (ref readonly var windowMessage in ReadMessages<ToggleWindowTypeMessage>()) |
|
55 | foreach (ref readonly var windowMessage in ReadMessages<ToggleWindowTypeMessage>()) |
|
66 | { |
|
56 | { |
|
67 | //Logging.Spy(windowMessage, "message"); |
|
||
|
68 | //Logging.Spy(windowMessage.Window, "message.Window"); |
|
||
|
69 | foreach (ref readonly var entity in ReadEntities<WindowTypeComponent>()) |
|
57 | foreach (ref readonly var entity in ReadEntities<WindowTypeComponent>()) |
|
70 | { |
|
58 | { |
|
71 |
|
|||
|
72 | var window_type = GetComponent<WindowTypeComponent>(entity).type; |
|
59 | var window_type = GetComponent<WindowTypeComponent>(entity).type; |
|
73 | if (window_type == windowMessage.Window) |
|
60 | if (window_type == windowMessage.Window) |
|
74 | { |
|
61 | { |
@@ -96,9 +83,8 | |||||
|
96 | else |
|
83 | else |
|
97 | { |
|
84 | { |
|
98 | Destroy(dialogMessage.Entity); |
|
85 | Destroy(dialogMessage.Entity); |
|
99 |
|
|||
|
100 | } |
|
86 | } |
|
101 | } |
|
87 | } |
|
102 | } |
|
88 | } |
|
103 | } |
|
89 | } |
|
104 | } |
|
90 | } |
You need to be logged in to leave comments.
Login now