Fixed operator [] overload for static arrays
This commit is contained in:
@@ -28,14 +28,18 @@ array_contains :: (static_array: Static_Array, value: static_array.Data_Type) ->
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
operator [] :: (static_array: Static_Array, index: int) -> static_array.Data_Type {
|
operator [] :: (static_array: *Static_Array, index: int) -> static_array.Data_Type {
|
||||||
return static_array.data[index];
|
return static_array.data[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
operator [] :: (static_array: *Static_Array, index: int) -> *static_array.Data_Type {
|
operator [] :: (static_array: Static_Array, index: int) -> *static_array.Data_Type {
|
||||||
|
return *static_array.data[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
operator *[] :: (static_array: *Static_Array, index: int) -> *static_array.Data_Type {
|
||||||
return *static_array.data[index];
|
return *static_array.data[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
operator []= :: (static_array: *Static_Array, index: int, value: static_array.Data_Type) {
|
operator []= :: (static_array: *Static_Array, index: int, value: static_array.Data_Type) {
|
||||||
static_array.data[index] = value;
|
static_array.data[index] = value;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -592,10 +592,10 @@ Entity_Storage :: struct {
|
|||||||
}
|
}
|
||||||
DONE
|
DONE
|
||||||
|
|
||||||
DELETE_ENTITY :: #string DONE
|
DELETE_ENTITY :: #string,\% DONE
|
||||||
delete_entity :: (e: *Entity) {
|
delete_entity :: (e: *Entity) {
|
||||||
// Delete the file too
|
// Delete the file too
|
||||||
path := tprint("../assets/scenes/%%/%%.ent", e.scene.name, e.id);
|
path := tprint("../assets/scenes/\%/\%.ent", e.scene.name, e.id);
|
||||||
File.file_delete(path);
|
File.file_delete(path);
|
||||||
|
|
||||||
destroy_entity(e);
|
destroy_entity(e);
|
||||||
@@ -609,7 +609,7 @@ delete_entity :: (e: *Entity) {
|
|||||||
|
|
||||||
DONE
|
DONE
|
||||||
|
|
||||||
SERIALIZE_ENTITY :: #string DONE
|
SERIALIZE_ENTITY :: #string,\% DONE
|
||||||
serialize_entity :: (e: *Entity, path: string) {
|
serialize_entity :: (e: *Entity, path: string) {
|
||||||
builder: String_Builder;
|
builder: String_Builder;
|
||||||
builder.allocator = temp;
|
builder.allocator = temp;
|
||||||
@@ -618,7 +618,7 @@ serialize_entity :: (e: *Entity, path: string) {
|
|||||||
%1
|
%1
|
||||||
}
|
}
|
||||||
|
|
||||||
File.write_entire_file(tprint("%%/%%.ent", path, e.id), builder_to_string(*builder));
|
File.write_entire_file(tprint("\%/\%.ent", path, e.id), builder_to_string(*builder));
|
||||||
}
|
}
|
||||||
DONE
|
DONE
|
||||||
|
|
||||||
@@ -695,4 +695,4 @@ PLACEHOLDER :: #string DONE
|
|||||||
#poke_name Coven entity_ui;
|
#poke_name Coven entity_ui;
|
||||||
#poke_name Coven duplicate_entity;
|
#poke_name Coven duplicate_entity;
|
||||||
}
|
}
|
||||||
DONE
|
DONE
|
||||||
|
|||||||
Reference in New Issue
Block a user