aboutsummaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-07-10 13:49:50 +0100
committerGinger Bill <bill@gingerbill.org>2017-07-10 13:49:50 +0100
commit66e4aaffc5d29710360ae238ab0c1285642ab6b8 (patch)
tree0a525411b3160616de9a7a7034a3b1298021d6b6 /code
parent81336b58cb17b5a31da7039be1ff4a6f0aa8f184 (diff)
Use semicolons as field delimiters in records
Diffstat (limited to 'code')
-rw-r--r--code/demo.odin48
1 files changed, 24 insertions, 24 deletions
diff --git a/code/demo.odin b/code/demo.odin
index e2825c5fa..7e330eefa 100644
--- a/code/demo.odin
+++ b/code/demo.odin
@@ -42,9 +42,9 @@ general_stuff :: proc() {
Foo :: struct {
- x: int,
- y: f32,
- z: string,
+ x: int;
+ y: f32;
+ z: string;
}
foo := Foo{123, 0.513, "A string"};
x, y, z := expand_to_tuple(foo);
@@ -176,8 +176,8 @@ default_return_values :: proc() {
};
Entity :: struct {
- name: string,
- id: u32,
+ name: string;
+ id: u32;
}
some_thing :: proc(input: int) -> (result: ^Entity = nil, err := Error.None) {
@@ -256,39 +256,39 @@ explicit_parametric_polymorphic_procedures :: proc() {
Vector2 :: struct {x, y: f32};
Entity :: struct {
- using position: Vector2,
- flags: u64,
- id: u64,
- batch_index: u32,
- slot_index: u32,
- portable_id: u32,
- derived: any,
+ using position: Vector2;
+ flags: u64;
+ id: u64;
+ batch_index: u32;
+ slot_index: u32;
+ portable_id: u32;
+ derived: any;
}
Rock :: struct {
- using entity: ^Entity,
- heavy: bool,
+ using entity: ^Entity;
+ heavy: bool;
}
Door :: struct {
- using entity: ^Entity,
- open: bool,
+ using entity: ^Entity;
+ open: bool;
}
Monster :: struct {
- using entity: ^Entity,
- is_robot: bool,
- is_zombie: bool,
+ using entity: ^Entity;
+ is_robot: bool;
+ is_zombie: bool;
}
EntityManager :: struct {
- batches: [dynamic]^EntityBatch,
- next_portable_id: u32,
+ batches: [dynamic]^EntityBatch;
+ next_portable_id: u32;
}
ENTITIES_PER_BATCH :: 16;
EntityBatch :: struct {
- data: [ENTITIES_PER_BATCH]Entity,
- occupied: [ENTITIES_PER_BATCH]bool,
- batch_index: u32,
+ data: [ENTITIES_PER_BATCH]Entity;
+ occupied: [ENTITIES_PER_BATCH]bool;
+ batch_index: u32;
}
use_empty_slot :: proc(manager: ^EntityManager, batch: ^EntityBatch) -> ^Entity {