| // Copyright 2025 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| library test.benchmark; |
| |
| type Address = struct { |
| x0 uint8; |
| x1 uint8; |
| x2 uint8; |
| x3 uint8; |
| }; |
| |
| type Log = struct { |
| address Address; |
| identity string; |
| userid string; |
| date string; |
| request string; |
| code uint16; |
| size uint64; |
| }; |
| |
| type Logs = struct { |
| logs vector<Log>; |
| }; |
| |
| // Mesh benchmark types |
| |
| type Vector3 = struct { |
| x float32; |
| y float32; |
| z float32; |
| }; |
| |
| type Triangle = struct { |
| v0 Vector3; |
| v1 Vector3; |
| v2 Vector3; |
| normal Vector3; |
| }; |
| |
| type Mesh = struct { |
| triangles vector<Triangle>; |
| }; |
| |
| // Minecraft types |
| |
| type GameType = strict enum : uint8 { |
| SURVIVAL = 0; |
| CREATIVE = 1; |
| ADVENTURE = 2; |
| SPECTATOR = 3; |
| }; |
| |
| type Item = struct { |
| count int8; |
| slot uint8; |
| id string; |
| }; |
| |
| type Abilities = struct { |
| walk_speed float32; |
| fly_speed float32; |
| may_fly bool; |
| flying bool; |
| invulnerable bool; |
| may_build bool; |
| instabuild bool; |
| }; |
| |
| type Vector3d = struct { |
| x float64; |
| y float64; |
| z float64; |
| }; |
| |
| type Vector2 = struct { |
| x float32; |
| y float32; |
| }; |
| |
| type Entity = struct { |
| id string; |
| pos Vector3d; |
| motion Vector3d; |
| rotation Vector3; |
| fall_distance float32; |
| fire uint16; |
| air uint16; |
| on_ground bool; |
| no_gravity bool; |
| invulnerable bool; |
| portal_cooldown int32; |
| uuid array<uint32, 4>; |
| custom_name string:optional; |
| custom_name_visible bool; |
| silent bool; |
| glowing bool; |
| }; |
| |
| type RecipeBook = struct { |
| recipes vector<string>; |
| to_be_displayed vector<string>; |
| is_filtering_craftable bool; |
| is_gui_open bool; |
| is_furnace_filtering_craftable bool; |
| is_furnace_gui_open bool; |
| is_blasting_furnace_filtering_craftable bool; |
| is_blasting_furnace_gui_open bool; |
| is_smoker_filtering_craftable bool; |
| is_smoker_gui_open bool; |
| }; |
| |
| type UuidAndEntity = struct { |
| uuid array<uint32, 4>; |
| entity Entity; |
| }; |
| |
| type Player = struct { |
| game_type GameType; |
| previous_game_type GameType; |
| score int64; |
| dimension string; |
| selected_item_slot uint32; |
| selected_item Item; |
| spawn_dimension string:optional; |
| spawn_x int64; |
| spawn_y int64; |
| spawn_z int64; |
| spawn_forced bool; |
| sleep_timer uint16; |
| food_exhaustion_level float32; |
| food_saturation_level float32; |
| food_tick_timer uint32; |
| xp_level uint32; |
| xp_p float32; |
| xp_total int32; |
| xp_seed int32; |
| inventory vector<Item>; |
| ender_items vector<Item>; |
| abilities Abilities; |
| entered_nether_position box<Vector3d>; |
| root_vehicle box<UuidAndEntity>; |
| shoulder_entity_left box<Entity>; |
| shoulder_entity_right box<Entity>; |
| seen_credits bool; |
| recipe_book RecipeBook; |
| }; |
| |
| type Players = struct { |
| players vector<Player>; |
| }; |