Skip to content

Commit 9fc38d8

Browse files
committed
Updating code affected after the refactor.
1 parent bbe30df commit 9fc38d8

File tree

14 files changed

+51
-64
lines changed

14 files changed

+51
-64
lines changed

source/code/core/tasks/public/ice/task.hxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#pragma once
55
#include <ice/task_promise.hxx>
6-
#include <ice/container_concepts.hxx>
76

87
namespace ice
98
{

source/code/framework/framework_base/private/framework_main.cxx

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ void ice_process_input_events(ice::Span<ice::input::InputEvent const> events, ic
560560
{
561561
for (ice::input::InputEvent const input_event : events)
562562
{
563-
ice::shards::push_back(out_shards, ice::ShardID_InputEvent | input_event);
563+
out_shards.push_back(ice::ShardID_InputEvent | input_event);
564564
}
565565
}
566566

@@ -585,7 +585,7 @@ auto ice_game_frame(
585585
ICE_ASSERT(new_frame != nullptr, "Failed to aquire next frame!");
586586

587587
// Push system events
588-
ice::shards::push_back(new_frame->shards(), system_events._data);
588+
new_frame->shards().push_back(system_events);
589589

590590
// Push previous frame events
591591
// Also runs other logic that should be done without interfeerence from
@@ -667,7 +667,7 @@ auto ice_update(
667667
ice::ShardContainer const& system_events = state.platform.core->system_events();
668668

669669
// Query platform events into the frame and input device handler.
670-
if (runtime.is_exiting || ice::shards::contains(system_events, ice::platform::Shard_AppQuit))
670+
if (runtime.is_exiting || system_events.contains(ice::platform::Shard_AppQuit))
671671
{
672672
runtime.is_exiting = true;
673673

@@ -690,11 +690,11 @@ auto ice_update(
690690
return ice::app::S_ApplicationExit;
691691
}
692692

693-
bool const was_resized = ice::shards::contains(system_events, ice::platform::ShardID_WindowResized);
694-
bool const was_minimized = ice::shards::contains(system_events, ice::platform::ShardID_WindowMinimized);
695-
bool const was_maximized = ice::shards::contains(system_events, ice::platform::ShardID_WindowMaximized);
693+
bool const was_resized = system_events.contains(ice::platform::ShardID_WindowResized);
694+
bool const was_minimized = system_events.contains(ice::platform::ShardID_WindowMinimized);
695+
bool const was_maximized = system_events.contains(ice::platform::ShardID_WindowMaximized);
696696
ice::vec2i window_size; // unused?
697-
bool const was_restored = ice::shards::inspect_last(system_events, ice::platform::ShardID_WindowRestored, window_size);
697+
bool const was_restored = system_events.inspect_last(ice::platform::ShardID_WindowRestored, window_size);
698698

699699
// We should never run into a situation where minimizing and restoring happen ad the same time.
700700
// TODO: Might want to turn this into a state machine.
@@ -747,16 +747,13 @@ auto ice_suspend(
747747

748748
if (runtime.is_exiting)
749749
{
750-
ice::shards::remove_all_of(
751-
runtime.frame->shards(),
752-
ice::ShardID_WorldActivate
753-
);
750+
runtime.frame->shards().remove_all_of(ice::ShardID_WorldActivate);
754751

755752
ice::Array<ice::StringID> worlds{ state.alloc };
756753
state.engine->worlds().query_worlds(worlds);
757754
for (ice::StringID_Arg world : worlds)
758755
{
759-
ice::shards::push_back(runtime.frame->shards(), ice::ShardID_WorldDeactivate | ice::stringid_hash(world));
756+
runtime.frame->shards().push_back(ice::ShardID_WorldDeactivate | ice::stringid_hash(world));
760757
}
761758

762759
// Apply state events so we can already get the events for the next frame

source/code/iceshard/engine/private/action/action_system.cxx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ namespace ice::action
172172
) noexcept
173173
{
174174
ice::ShardContainer new_shards{ _step_shards_alloc };
175-
ice::shards::reserve(new_shards, 64);
175+
new_shards.reserve(64);
176176

177177
for (ActionInstance* const action : _actions)
178178
{
@@ -208,12 +208,12 @@ namespace ice::action
208208
if (action->state == ActionState::Active)
209209
{
210210
ice::StringID_Hash action_name = ice::stringid_hash(action->name);
211-
ice::shards::push_back(new_shards, ice::action::Shard_ActionEventReset | action_name);
211+
new_shards.push_back(ice::action::Shard_ActionEventReset | action_name);
212212

213213
current_stage = stages + action->current_stage_idx;
214214
if (current_stage->stage_shardid != ice::Shard_Invalid)
215215
{
216-
ice::shards::push_back(new_shards, ice::shard(current_stage->stage_shardid) | action_name);
216+
new_shards.push_back(ice::shard(current_stage->stage_shardid) | action_name);
217217
}
218218
}
219219
}
@@ -276,7 +276,7 @@ namespace ice::action
276276

277277
if (current_stage->stage_shardid != ice::Shard_Invalid)
278278
{
279-
ice::shards::push_back(new_shards, ice::shard(current_stage->stage_shardid) | ice::stringid_hash(action->name));
279+
new_shards.push_back(ice::shard(current_stage->stage_shardid) | ice::stringid_hash(action->name));
280280
}
281281
}
282282
}
@@ -293,15 +293,15 @@ namespace ice::action
293293
{
294294
if (action->state == ActionState::FinishedSuccess)
295295
{
296-
ice::shards::push_back(new_shards, ice::action::Shard_ActionEventSuccess | ice::stringid_hash(action->name));
296+
new_shards.push_back(ice::action::Shard_ActionEventSuccess | ice::stringid_hash(action->name));
297297
}
298298
else if (action->state == ActionState::FinishedFailure)
299299
{
300-
ice::shards::push_back(new_shards, ice::action::Shard_ActionEventFailed | ice::stringid_hash(action->name));
300+
new_shards.push_back(ice::action::Shard_ActionEventFailed | ice::stringid_hash(action->name));
301301
}
302302
}
303303

304-
ice::shards::push_back(shards, new_shards._data);
304+
shards.push_back(new_shards);
305305
}
306306

307307
auto create_action_system(

source/code/iceshard/engine/private/engine_state_tracker_default.cxx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ namespace ice
155155
{
156156
ice::StackAllocator<512_B> temp_alloc;
157157
ice::ShardContainer temp_shards{ temp_alloc };
158-
temp_shards._data.reserve(
158+
temp_shards.reserve(
159159
ice::mem_max_capacity(
160160
ice::size_of<ice::Shard>,
161161
decltype(temp_alloc)::Constant_InternalCapacity
@@ -170,8 +170,8 @@ namespace ice
170170
if (collect_pending_states(*input_shards))
171171
{
172172
// Push back temporary shards into output shards
173-
ice::shards::push_back(out_shards, temp_shards._data);
174-
ice::shards::clear(temp_shards);
173+
out_shards.push_back(temp_shards);
174+
temp_shards.clear();
175175

176176
// Commit the new states and gather the new shards
177177
_pending_states.for_each([&temp_shards](EngineStatePending const& pending) noexcept
@@ -200,17 +200,17 @@ namespace ice
200200
else
201201
{
202202
// Output temporary shards since they might trigger other events.
203-
ice::shards::push_back(out_shards, temp_shards._data);
203+
out_shards.push_back(temp_shards);
204204

205205
// Clear temporary shards so we can escape the loop normally.
206-
ice::shards::clear(temp_shards);
206+
temp_shards.clear();
207207
}
208208

209209
// Set input shards to temp_shards
210210
input_shards = &temp_shards;
211211

212212
// If we have any shards added, check if we can collect another set of states.
213-
} while (ice::shards::empty(temp_shards) == false);
213+
} while (temp_shards.not_empty());
214214

215215
return true;
216216
}
@@ -292,8 +292,7 @@ namespace ice
292292
{
293293
for (ice::EngineStateTrigger const& trigger : _available_triggers)
294294
{
295-
ice::shards::for_each(
296-
shards,
295+
shards.for_each(
297296
trigger.when,
298297
[&](ice::Shard shard) noexcept
299298
{

source/code/iceshard/engine/private/engine_state_tracker_default.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <ice/engine_state_tracker.hxx>
66
#include <ice/array.hxx>
77
#include <ice/queue.hxx>
8-
#include <ice/hashmap.hxx>
8+
#include <ice/multi_hashmap.hxx>
99
#include <ice/mem_allocator_stack.hxx>
1010
#include <ice/log.hxx>
1111

source/code/iceshard/iceshard/private/iceshard_frame.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ namespace ice
124124

125125
auto IceshardEngineFrame::extract_tasks() noexcept -> ice::Array<ice::Task<>>
126126
{
127-
return ice::Array<ice::Task<>>{ *_shards._data._allocator };
127+
return ice::Array<ice::Task<>>{ *_shards._allocator };
128128
}
129129

130130
auto create_iceshard_frame(

source/code/iceshard/iceshard/private/iceshard_runner.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ namespace ice
215215
if (trigger.to == State_WorldRuntimeActive)
216216
{
217217
ice::wait_for(world->activate(params));
218-
ice::shards::push_back(out_shards, trigger.results | world_name.value);
218+
out_shards.push_back(trigger.results | world_name.value);
219219
}
220220
else if (trigger.to == State_WorldRuntimeInactive)
221221
{

source/code/iceshard/iceshard/private/iceshard_trait_context.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ namespace ice
7676
// Push shards into the out container. (ice::detail::TraitEvent decays into ice::Shard)
7777
for (ice::Shard shard : _events_expired)
7878
{
79-
ice::shards::push_back(out_shards, shard);
79+
out_shards.push_back(shard);
8080
}
8181
}
8282

source/code/iceshard/iceshard/private/iceshard_world.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ namespace ice
4141

4242
if (_devui != nullptr && _devui->world_operation != ice::Shard_Invalid)
4343
{
44-
ice::shards::push_back(out_shards, ice::exchange(_devui->world_operation, ice::Shard_Invalid));
44+
out_shards.push_back(ice::exchange(_devui->world_operation, ice::Shard_Invalid));
4545
}
4646
}
4747

source/code/iceshard/iceshard/private/iceshard_world_manager.cxx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace ice
4545
) noexcept -> ice::Task<>
4646
{
4747
co_await task;
48-
ice::shards::push_back(out_shards, shard);
48+
out_shards.push_back(shard);
4949
}
5050

5151
} // namespace detail
@@ -147,8 +147,7 @@ namespace ice
147147
Entry world_entry{ .context = ice::move(world_context), .world = world };
148148

149149
// Add a new pending event
150-
ice::shards::push_back(
151-
_pending_events,
150+
_pending_events.push_back(
152151
ice::ShardID_WorldCreated | ice::stringid_hash(world_template.name)
153152
);
154153

@@ -178,8 +177,7 @@ namespace ice
178177
);
179178

180179
// Add a new pending event
181-
ice::shards::push_back(
182-
_pending_events,
180+
_pending_events.push_back(
183181
ice::ShardID_WorldDestroyed | ice::stringid_hash(name)
184182
);
185183

@@ -199,8 +197,8 @@ namespace ice
199197

200198
void IceshardWorldManager::query_pending_events(ice::ShardContainer& out_events) noexcept
201199
{
202-
ice::shards::push_back(out_events, _pending_events._data);
203-
ice::shards::clear(_pending_events);
200+
out_events.push_back(_pending_events);
201+
_pending_events.clear();
204202
}
205203

206204
void IceshardWorldManager::pre_update(
@@ -260,7 +258,7 @@ namespace ice
260258

261259
if (trigger.results != ice::Shard_Invalid)
262260
{
263-
ice::shards::push_back(out_shards, trigger.results | world_name);
261+
out_shards.push_back(trigger.results | world_name);
264262
}
265263
}
266264

0 commit comments

Comments
 (0)