Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions gateway/src/stdb/bindings/creature_instruction_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use super::event_ai_quest_credit_type::EventAiQuestCredit;
use super::facing_instruction_type::FacingInstruction;
use super::force_despawn_instruction_type::ForceDespawnInstruction;
use super::increment_phase_instruction_type::IncrementPhaseInstruction;
use super::instruction_target_type::InstructionTarget;
use super::missing_text_template_no_effect_type::MissingTextTemplateNoEffect;
use super::movement_operation_type::MovementOperation;
use super::notify_encounter_instruction_type::NotifyEncounterInstruction;
Expand Down Expand Up @@ -95,6 +96,8 @@ pub enum CreatureInstruction {
NotifyEncounter(NotifyEncounterInstruction),

StartRelay(StartRelayInstruction),

AttackStart(InstructionTarget),
}

impl __sdk::InModule for CreatureInstruction {
Expand Down
230 changes: 230 additions & 0 deletions gateway/src/stdb/bindings/game_quest_reward_spell_table.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.

#![allow(unused, clippy::all)]
use super::quest_reward_spell_type::QuestRewardSpell;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};

/// Table handle for the table `game_quest_reward_spell`.
///
/// Obtain a handle from the [`GameQuestRewardSpellTableAccess::game_quest_reward_spell`] method on [`super::RemoteTables`],
/// like `ctx.db.game_quest_reward_spell()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.game_quest_reward_spell().on_insert(...)`.
pub struct GameQuestRewardSpellTableHandle<'ctx> {
imp: __sdk::TableHandle<QuestRewardSpell>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}

/// Lifetime-aware accessor marker for the table `game_quest_reward_spell`.
pub struct GameQuestRewardSpellTableAccessor;

impl __sdk::TableAccessor<super::RemoteTables> for GameQuestRewardSpellTableAccessor {
type Row = QuestRewardSpell;
type Handle<'db> = GameQuestRewardSpellTableHandle<'db>;

fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> {
db.game_quest_reward_spell()
}
}

#[allow(non_camel_case_types)]
/// Extension trait for access to the table `game_quest_reward_spell`.
///
/// Implemented for [`super::RemoteTables`].
pub trait GameQuestRewardSpellTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`GameQuestRewardSpellTableHandle`], which mediates access to the table `game_quest_reward_spell`.
fn game_quest_reward_spell(&self) -> GameQuestRewardSpellTableHandle<'_>;
}

impl GameQuestRewardSpellTableAccess for super::RemoteTables {
fn game_quest_reward_spell(&self) -> GameQuestRewardSpellTableHandle<'_> {
GameQuestRewardSpellTableHandle {
imp: self
.imp
.get_table::<QuestRewardSpell>("game_quest_reward_spell"),
ctx: std::marker::PhantomData,
}
}
}

pub struct GameQuestRewardSpellInsertCallbackId(__sdk::CallbackId);
pub struct GameQuestRewardSpellDeleteCallbackId(__sdk::CallbackId);

impl<'ctx> __sdk::TableLike for GameQuestRewardSpellTableHandle<'ctx> {
type Row = QuestRewardSpell;
type EventContext = super::EventContext;

fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = QuestRewardSpell> + '_ {
self.imp.iter()
}
}

impl<'ctx> __sdk::Table for GameQuestRewardSpellTableHandle<'ctx> {
type Row = QuestRewardSpell;
type EventContext = super::EventContext;

fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = QuestRewardSpell> + '_ {
self.imp.iter()
}

type InsertCallbackId = GameQuestRewardSpellInsertCallbackId;

fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> GameQuestRewardSpellInsertCallbackId {
GameQuestRewardSpellInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}

fn remove_on_insert(&self, callback: GameQuestRewardSpellInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}

type DeleteCallbackId = GameQuestRewardSpellDeleteCallbackId;

fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> GameQuestRewardSpellDeleteCallbackId {
GameQuestRewardSpellDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}

fn remove_on_delete(&self, callback: GameQuestRewardSpellDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}

impl<'ctx> __sdk::WithInsert for GameQuestRewardSpellTableHandle<'ctx> {
type InsertCallbackId = GameQuestRewardSpellInsertCallbackId;

fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> GameQuestRewardSpellInsertCallbackId {
GameQuestRewardSpellInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}

fn remove_on_insert(&self, callback: GameQuestRewardSpellInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
}

impl<'ctx> __sdk::WithDelete for GameQuestRewardSpellTableHandle<'ctx> {
type DeleteCallbackId = GameQuestRewardSpellDeleteCallbackId;

fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> GameQuestRewardSpellDeleteCallbackId {
GameQuestRewardSpellDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}

fn remove_on_delete(&self, callback: GameQuestRewardSpellDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}

pub struct GameQuestRewardSpellUpdateCallbackId(__sdk::CallbackId);

impl<'ctx> __sdk::TableWithPrimaryKey for GameQuestRewardSpellTableHandle<'ctx> {
type UpdateCallbackId = GameQuestRewardSpellUpdateCallbackId;

fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> GameQuestRewardSpellUpdateCallbackId {
GameQuestRewardSpellUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}

fn remove_on_update(&self, callback: GameQuestRewardSpellUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}

impl<'ctx> __sdk::WithUpdate for GameQuestRewardSpellTableHandle<'ctx> {
type UpdateCallbackId = GameQuestRewardSpellUpdateCallbackId;

fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> GameQuestRewardSpellUpdateCallbackId {
GameQuestRewardSpellUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}

fn remove_on_update(&self, callback: GameQuestRewardSpellUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}

/// Access to the `quest_entry` unique index on the table `game_quest_reward_spell`,
/// which allows point queries on the field of the same name
/// via the [`GameQuestRewardSpellQuestEntryUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.game_quest_reward_spell().quest_entry().find(...)`.
pub struct GameQuestRewardSpellQuestEntryUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<QuestRewardSpell, u32>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}

impl<'ctx> GameQuestRewardSpellTableHandle<'ctx> {
/// Get a handle on the `quest_entry` unique index on the table `game_quest_reward_spell`.
pub fn quest_entry(&self) -> GameQuestRewardSpellQuestEntryUnique<'ctx> {
GameQuestRewardSpellQuestEntryUnique {
imp: self.imp.get_unique_constraint::<u32>("quest_entry"),
phantom: std::marker::PhantomData,
}
}
}

impl<'ctx> GameQuestRewardSpellQuestEntryUnique<'ctx> {
/// Find the subscribed row whose `quest_entry` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &u32) -> Option<QuestRewardSpell> {
self.imp.find(col_val)
}
}

#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<QuestRewardSpell>("game_quest_reward_spell");
_table.add_unique_constraint::<u32>("quest_entry", |row| &row.quest_entry);
}

#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<QuestRewardSpell>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<QuestRewardSpell>", "TableUpdate")
.with_cause(e)
.into()
})
}

#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `QuestRewardSpell`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait game_quest_reward_spellQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `QuestRewardSpell`.
fn game_quest_reward_spell(&self) -> __sdk::__query_builder::Table<QuestRewardSpell>;
}

impl game_quest_reward_spellQueryTableAccess for __sdk::QueryTableAccessor {
fn game_quest_reward_spell(&self) -> __sdk::__query_builder::Table<QuestRewardSpell> {
__sdk::__query_builder::Table::new("game_quest_reward_spell")
}
}
28 changes: 28 additions & 0 deletions gateway/src/stdb/bindings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ pub mod game_quest_event_requirement_table;
pub mod game_quest_objective_table;
pub mod game_quest_reward_choice_table;
pub mod game_quest_reward_item_table;
pub mod game_quest_reward_spell_table;
pub mod game_quest_template_table;
pub mod game_quest_text_table;
pub mod game_race_info_table;
Expand Down Expand Up @@ -771,6 +772,7 @@ pub mod quest_event_type;
pub mod quest_objective_type;
pub mod quest_reward_choice_type;
pub mod quest_reward_item_type;
pub mod quest_reward_spell_type;
pub mod quest_taken_predicate_type;
pub mod quest_template_type;
pub mod quest_text_type;
Expand Down Expand Up @@ -1457,6 +1459,7 @@ pub use game_quest_event_requirement_table::*;
pub use game_quest_objective_table::*;
pub use game_quest_reward_choice_table::*;
pub use game_quest_reward_item_table::*;
pub use game_quest_reward_spell_table::*;
pub use game_quest_template_table::*;
pub use game_quest_text_table::*;
pub use game_race_info_table::*;
Expand Down Expand Up @@ -1738,6 +1741,7 @@ pub use quest_event_type::QuestEvent;
pub use quest_objective_type::QuestObjective;
pub use quest_reward_choice_type::QuestRewardChoice;
pub use quest_reward_item_type::QuestRewardItem;
pub use quest_reward_spell_type::QuestRewardSpell;
pub use quest_taken_predicate_type::QuestTakenPredicate;
pub use quest_template_type::QuestTemplate;
pub use quest_text_type::QuestText;
Expand Down Expand Up @@ -6986,6 +6990,7 @@ pub struct DbUpdate {
game_quest_objective: __sdk::TableUpdate<QuestObjective>,
game_quest_reward_choice: __sdk::TableUpdate<QuestRewardChoice>,
game_quest_reward_item: __sdk::TableUpdate<QuestRewardItem>,
game_quest_reward_spell: __sdk::TableUpdate<QuestRewardSpell>,
game_quest_template: __sdk::TableUpdate<QuestTemplate>,
game_quest_text: __sdk::TableUpdate<QuestText>,
game_race_info: __sdk::TableUpdate<RaceInfo>,
Expand Down Expand Up @@ -7628,6 +7633,9 @@ impl TryFrom<__ws::v2::TransactionUpdate> for DbUpdate {
"game_quest_reward_item" => db_update.game_quest_reward_item.append(
game_quest_reward_item_table::parse_table_update(table_update)?,
),
"game_quest_reward_spell" => db_update.game_quest_reward_spell.append(
game_quest_reward_spell_table::parse_table_update(table_update)?,
),
"game_quest_template" => db_update
.game_quest_template
.append(game_quest_template_table::parse_table_update(table_update)?),
Expand Down Expand Up @@ -8652,6 +8660,12 @@ impl __sdk::DbUpdate for DbUpdate {
&self.game_quest_reward_item,
)
.with_updates_by_pk(|row| &row.id);
diff.game_quest_reward_spell = cache
.apply_diff_to_table::<QuestRewardSpell>(
"game_quest_reward_spell",
&self.game_quest_reward_spell,
)
.with_updates_by_pk(|row| &row.quest_entry);
diff.game_quest_template = cache
.apply_diff_to_table::<QuestTemplate>("game_quest_template", &self.game_quest_template)
.with_updates_by_pk(|row| &row.entry);
Expand Down Expand Up @@ -9454,6 +9468,9 @@ impl __sdk::DbUpdate for DbUpdate {
"game_quest_reward_item" => db_update
.game_quest_reward_item
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
"game_quest_reward_spell" => db_update
.game_quest_reward_spell
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
"game_quest_template" => db_update
.game_quest_template
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
Expand Down Expand Up @@ -10187,6 +10204,9 @@ impl __sdk::DbUpdate for DbUpdate {
"game_quest_reward_item" => db_update
.game_quest_reward_item
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
"game_quest_reward_spell" => db_update
.game_quest_reward_spell
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
"game_quest_template" => db_update
.game_quest_template
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
Expand Down Expand Up @@ -10585,6 +10605,7 @@ pub struct AppliedDiff<'r> {
game_quest_objective: __sdk::TableAppliedDiff<'r, QuestObjective>,
game_quest_reward_choice: __sdk::TableAppliedDiff<'r, QuestRewardChoice>,
game_quest_reward_item: __sdk::TableAppliedDiff<'r, QuestRewardItem>,
game_quest_reward_spell: __sdk::TableAppliedDiff<'r, QuestRewardSpell>,
game_quest_template: __sdk::TableAppliedDiff<'r, QuestTemplate>,
game_quest_text: __sdk::TableAppliedDiff<'r, QuestText>,
game_race_info: __sdk::TableAppliedDiff<'r, RaceInfo>,
Expand Down Expand Up @@ -11478,6 +11499,11 @@ impl<'r> __sdk::AppliedDiff<'r> for AppliedDiff<'r> {
&self.game_quest_reward_item,
event,
);
callbacks.invoke_table_row_callbacks::<QuestRewardSpell>(
"game_quest_reward_spell",
&self.game_quest_reward_spell,
event,
);
callbacks.invoke_table_row_callbacks::<QuestTemplate>(
"game_quest_template",
&self.game_quest_template,
Expand Down Expand Up @@ -12638,6 +12664,7 @@ impl __sdk::SpacetimeModule for RemoteModule {
game_quest_objective_table::register_table(client_cache);
game_quest_reward_choice_table::register_table(client_cache);
game_quest_reward_item_table::register_table(client_cache);
game_quest_reward_spell_table::register_table(client_cache);
game_quest_template_table::register_table(client_cache);
game_quest_text_table::register_table(client_cache);
game_race_info_table::register_table(client_cache);
Expand Down Expand Up @@ -12880,6 +12907,7 @@ impl __sdk::SpacetimeModule for RemoteModule {
"game_quest_objective",
"game_quest_reward_choice",
"game_quest_reward_item",
"game_quest_reward_spell",
"game_quest_template",
"game_quest_text",
"game_race_info",
Expand Down
Loading