Skip to content

Commit 72979b4

Browse files
committed
remove legacy spawn_with
1 parent 189269f commit 72979b4

4 files changed

Lines changed: 70 additions & 225 deletions

File tree

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ clone :: entity -> <fragment, component>? -> entity
100100
101101
spawn_at :: chunk?, fragment[]?, component[]? -> entity
102102
spawn_as :: entity?, fragment[]?, component[]? -> entity
103-
spawn_with :: fragment[]?, component[]? -> entity
104103
105104
debug_mode :: boolean -> ()
106105
collect_garbage :: ()

develop/unbench.lua

Lines changed: 5 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ basics.describe_bench(string.format('create and destroy %d entities with 1 compo
798798
local fragments = { F1 }
799799
local components = { true }
800800

801-
local prefab = evo.spawn_with(fragments, components)
801+
local prefab = evo.spawn { [F1] = true }
802802

803803
for i = 1, N do
804804
entities[i] = spawn_as(prefab, fragments, components)
@@ -817,7 +817,7 @@ basics.describe_bench(string.format('create and destroy %d entities with 2 compo
817817
local fragments = { F1, F2 }
818818
local components = { true, true }
819819

820-
local prefab = evo.spawn_with(fragments, components)
820+
local prefab = evo.spawn { [F1] = true, [F2] = true }
821821

822822
for i = 1, N do
823823
entities[i] = spawn_as(prefab, fragments, components)
@@ -836,7 +836,7 @@ basics.describe_bench(string.format('create and destroy %d entities with 3 compo
836836
local fragments = { F1, F2, F3 }
837837
local components = { true, true, true }
838838

839-
local prefab = evo.spawn_with(fragments, components)
839+
local prefab = evo.spawn { [F1] = true, [F2] = true, [F3] = true }
840840

841841
for i = 1, N do
842842
entities[i] = spawn_as(prefab, fragments, components)
@@ -855,7 +855,7 @@ basics.describe_bench(string.format('create and destroy %d entities with 4 compo
855855
local fragments = { F1, F2, F3, F4 }
856856
local components = { true, true, true, true }
857857

858-
local prefab = evo.spawn_with(fragments, components)
858+
local prefab = evo.spawn { [F1] = true, [F2] = true, [F3] = true, [F4] = true }
859859

860860
for i = 1, N do
861861
entities[i] = spawn_as(prefab, fragments, components)
@@ -874,7 +874,7 @@ basics.describe_bench(string.format('create and destroy %d entities with 5 compo
874874
local fragments = { F1, F2, F3, F4, F5 }
875875
local components = { true, true, true, true, true }
876876

877-
local prefab = evo.spawn_with(fragments, components)
877+
local prefab = evo.spawn { [F1] = true, [F2] = true, [F3] = true, [F4] = true, [F5] = true }
878878

879879
for i = 1, N do
880880
entities[i] = spawn_as(prefab, fragments, components)
@@ -886,90 +886,3 @@ basics.describe_bench(string.format('create and destroy %d entities with 5 compo
886886
end)
887887

888888
print '----------------------------------------'
889-
890-
basics.describe_bench(string.format('create and destroy %d entities with 1 components / spawn_with', N),
891-
---@param entities evolved.id[]
892-
function(entities)
893-
local spawn_with = evo.spawn_with
894-
895-
local fragments = { F1 }
896-
local components = { true }
897-
898-
for i = 1, N do
899-
entities[i] = spawn_with(fragments, components)
900-
end
901-
902-
evo.batch_destroy(Q1)
903-
end, function()
904-
return {}
905-
end)
906-
907-
basics.describe_bench(string.format('create and destroy %d entities with 2 components / spawn_with', N),
908-
---@param entities evolved.id[]
909-
function(entities)
910-
local spawn_with = evo.spawn_with
911-
912-
local fragments = { F1, F2 }
913-
local components = { true, true }
914-
915-
for i = 1, N do
916-
entities[i] = spawn_with(fragments, components)
917-
end
918-
919-
evo.batch_destroy(Q1)
920-
end, function()
921-
return {}
922-
end)
923-
924-
basics.describe_bench(string.format('create and destroy %d entities with 3 components / spawn_with', N),
925-
---@param entities evolved.id[]
926-
function(entities)
927-
local spawn_with = evo.spawn_with
928-
929-
local fragments = { F1, F2, F3 }
930-
local components = { true, true, true }
931-
932-
for i = 1, N do
933-
entities[i] = spawn_with(fragments, components)
934-
end
935-
936-
evo.batch_destroy(Q1)
937-
end, function()
938-
return {}
939-
end)
940-
941-
basics.describe_bench(string.format('create and destroy %d entities with 4 components / spawn_with', N),
942-
---@param entities evolved.id[]
943-
function(entities)
944-
local spawn_with = evo.spawn_with
945-
946-
local fragments = { F1, F2, F3, F4 }
947-
local components = { true, true, true, true }
948-
949-
for i = 1, N do
950-
entities[i] = spawn_with(fragments, components)
951-
end
952-
953-
evo.batch_destroy(Q1)
954-
end, function()
955-
return {}
956-
end)
957-
958-
basics.describe_bench(string.format('create and destroy %d entities with 5 components / spawn_with', N),
959-
---@param entities evolved.id[]
960-
function(entities)
961-
local spawn_with = evo.spawn_with
962-
963-
local fragments = { F1, F2, F3, F4, F5 }
964-
local components = { true, true, true, true, true }
965-
966-
for i = 1, N do
967-
entities[i] = spawn_with(fragments, components)
968-
end
969-
970-
evo.batch_destroy(Q1)
971-
end, function()
972-
return {}
973-
end)
974-
975-
print '----------------------------------------'

0 commit comments

Comments
 (0)