Fix build, prep for Turn Toggle

This commit is contained in:
Condorra 2024-01-13 18:01:19 +11:00
parent 28654a5130
commit 6126bc984b
3 changed files with 17 additions and 1 deletions

View File

@ -407,7 +407,7 @@ impl DBTrans {
Ok(()) Ok(())
} }
#[deny(dead_code)] #[warn(dead_code)]
pub async fn find_by_username<'a>(self: &'a Self, username: &'a str) -> DResult<Option<User>> { pub async fn find_by_username<'a>(self: &'a Self, username: &'a str) -> DResult<Option<User>> {
if let Some(details_json) = self if let Some(details_json) = self
.pg_trans()? .pg_trans()?

View File

@ -609,6 +609,9 @@ pub enum ItemSpecialData {
HanoiPuzzle { HanoiPuzzle {
towers: [Vec<u8>; 3], towers: [Vec<u8>; 3],
}, },
ToggleData {
turned_on: bool,
},
} }
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, PartialOrd)] #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, PartialOrd)]

View File

@ -244,6 +244,17 @@ pub trait InstallHandler {
) -> UResult<()>; ) -> UResult<()>;
} }
#[async_trait]
pub trait TurnToggleHandler {
async fn turn_cmd(
&self,
ctx: &mut VerbContext,
player: &Item,
what: &Item,
turn_on: bool,
) -> UResult<()>;
}
pub trait ContainerCheck { pub trait ContainerCheck {
fn check_place(&self, container: &Item, item: &Item) -> UResult<()>; fn check_place(&self, container: &Item, item: &Item) -> UResult<()>;
} }
@ -321,6 +332,7 @@ pub struct PossessionData {
pub lockcheck_handler: Option<&'static (dyn LockcheckHandler + Sync + Send)>, pub lockcheck_handler: Option<&'static (dyn LockcheckHandler + Sync + Send)>,
pub sign_handler: Option<&'static (dyn ArglessHandler + Sync + Send)>, pub sign_handler: Option<&'static (dyn ArglessHandler + Sync + Send)>,
pub write_handler: Option<&'static (dyn WriteHandler + Sync + Send)>, pub write_handler: Option<&'static (dyn WriteHandler + Sync + Send)>,
pub turn_toggle_handler: Option<&'static (dyn TurnToggleHandler + Sync + Send)>,
pub can_butcher: bool, pub can_butcher: bool,
pub bench_data: Option<&'static (dyn BenchData + Sync + Send)>, pub bench_data: Option<&'static (dyn BenchData + Sync + Send)>,
pub wear_data: Option<WearData>, pub wear_data: Option<WearData>,
@ -347,6 +359,7 @@ impl Default for PossessionData {
lockcheck_handler: None, lockcheck_handler: None,
sign_handler: None, sign_handler: None,
write_handler: None, write_handler: None,
turn_toggle_handler: None,
can_butcher: false, can_butcher: false,
bench_data: None, bench_data: None,
wear_data: None, wear_data: None,