use crate::utils::{union_sets, create_enum};
use crate::hash::HashMap;
use crate::context::Context;
const ACTIONS: [&str; 22] = [
"actorInput",
"actors",
"addSymbol",
"batch",
"changeComponent",
"components",
"createEntity",
"entities",
"fetchSymbol",
"getSymbol",
"mergeActors",
"mergeComponents",
"mergeEntities",
"mergeSymbols",
"mergeSymbol",
"removeActor",
"removeComponent",
"removeEntity",
"spawnActor",
"symbol",
"symbols",
"upsertComponent",
];
const COMMON_COMPONENTS: [&str; 7] = [
"collider",
"color",
"hidden",
"position",
"rotation",
"velocity",
"spin",
];
pub const DEFAULT_SYMBOLS: [String; ACTIONS.len() + COMMON_COMPONENTS.len()] = union_sets(&ACTIONS, &COMMON_COMPONENTS);
pub struct DefaultOptions {
skip_pending: bool,
compress_strings_as_ints: bool,
is_symbol_leader: bool,
is_symbol_relay: bool,
is_component_relay: bool,
is_ticked: bool,
is_diffed: bool,
is_rollback: bool, }
pub struct DefaultUpdateOptions {
mask: Option<MaskType>,
type: bool,
batched: bool,
batch_size: usize,
}
pub const PAD_ENUM: usize = 0;
pub const ENUM_ACTIONS: HashMap<&str, usize> = create_enum(&ACTIONS, PAD_ENUM);
pub const ENUM_COMMON_COMPONENTS: HashMap<&str, usize> = create_enum(&COMMON_COMPONENTS, ACTIONS.len() + PAD_ENUM);
pub const ENUM_DEFAULT_SYMBOLS: HashMap<&str, usize> = create_enum(&DEFAULT_SYMBOLS, PAD_ENUM);
pub const BATCH_ACTION_PAYLOAD_SIZES: HashMap<&str, usize> = [
("changeComponent", 3),
("removeComponent", 2),
("upsertComponent", 3),
].iter().cloned().collect();
pub const DEFAULT_VALID_KEYS: HashMap<&str, bool> = [
("collider", true),
("color", true),
("hidden", true),
("position", true),
("rotation", true),
("velocity", true),
("spin", true),
].iter().cloned().collect();
pub fn void_responder() {}
pub trait Payload {
fn get_id(&self) -> Option<&str>;
}
pub fn default_get_actor_id(payload: &dyn Payload, _context: &dyn Context) -> Option<&str> {
payload.get_id()
}