Trait otter_api_tests::PieceTrait [−][src]
pub trait PieceTrait: 'static + OutlineTrait + Send + Debug + Serialize + Deserialize { fn nfaces(&self) -> u8; fn svg_piece(
&self,
f: &mut Html,
gpc: &GPiece,
gs: &GameState,
id: VisiblePieceId
) -> Result<(), InternalError>; fn describe_html(
&self,
gpc: &GPiece,
_goccults: &GameOccults
) -> Result<Html, InternalError>; fn itemname(&self) -> &str; fn add_ui_operations(
&self,
ShowUnocculted,
_upd: &mut Vec<UoDescription, Global>,
_gs: &GameState,
_gpc: &GPiece
) -> Result<(), InternalError> { ... } fn ui_operation(
&self,
ShowUnocculted,
_a: ApiPieceOpArgs<'_>,
_opname: &str,
_wrc: WhatResponseToClientOp
) -> Result<(PieceUpdate, Option<Box<dyn FnOnce(&'r mut PrepareUpdatesBuffer<'_>) + 'static, Global>>), ApiPieceOpError> { ... } fn held_change_hook(
&self,
_ig: &InstanceRef,
_gpieces: &mut GPieces,
_piece: PieceId,
_was_held: Option<PlayerId>
) -> Result<Option<Box<dyn FnOnce(&'r mut PrepareUpdatesBuffer<'_>) + 'static, Global>>, InternalError> { ... } fn loaded_hook(
&self,
_piece: PieceId,
_gs: &mut GameState,
_ig: &InstanceRef
) -> Result<(), InternalError> { ... } fn delete_hook(
&self,
_p: &GPiece,
_gs: &mut GameState
) -> ExecuteGameChangeUpdates { ... } fn sortkey(&self) -> Option<&str> { ... } fn occultation_notify_hook(
&self,
_piece: PieceId
) -> Option<Box<dyn FnOnce(&'r mut PrepareUpdatesBuffer<'_>) + 'static, Global>> { ... } fn abs_bbox(&self, p: &GPiece) -> Result<RectC<i32>, InternalError> { ... } }
Required methods
fn svg_piece(
&self,
f: &mut Html,
gpc: &GPiece,
gs: &GameState,
id: VisiblePieceId
) -> Result<(), InternalError>
[src]fn describe_html(
&self,
gpc: &GPiece,
_goccults: &GameOccults
) -> Result<Html, InternalError>
[src]Provided methods
fn add_ui_operations(
&self,
ShowUnocculted,
_upd: &mut Vec<UoDescription, Global>,
_gs: &GameState,
_gpc: &GPiece
) -> Result<(), InternalError>
[src]fn ui_operation(
&self,
ShowUnocculted,
_a: ApiPieceOpArgs<'_>,
_opname: &str,
_wrc: WhatResponseToClientOp
) -> Result<(PieceUpdate, Option<Box<dyn FnOnce(&'r mut PrepareUpdatesBuffer<'_>) + 'static, Global>>), ApiPieceOpError>
[src]fn held_change_hook(
&self,
_ig: &InstanceRef,
_gpieces: &mut GPieces,
_piece: PieceId,
_was_held: Option<PlayerId>
) -> Result<Option<Box<dyn FnOnce(&'r mut PrepareUpdatesBuffer<'_>) + 'static, Global>>, InternalError>
[src]
fn held_change_hook(
&self,
_ig: &InstanceRef,
_gpieces: &mut GPieces,
_piece: PieceId,
_was_held: Option<PlayerId>
) -> Result<Option<Box<dyn FnOnce(&'r mut PrepareUpdatesBuffer<'_>) + 'static, Global>>, InternalError>
[src]Piece is responsible for dealing with the possibility that they may be occulted!
fn loaded_hook(
&self,
_piece: PieceId,
_gs: &mut GameState,
_ig: &InstanceRef
) -> Result<(), InternalError>
[src]fn delete_hook(
&self,
_p: &GPiece,
_gs: &mut GameState
) -> ExecuteGameChangeUpdates
[src]
fn delete_hook(
&self,
_p: &GPiece,
_gs: &mut GameState
) -> ExecuteGameChangeUpdates
[src]Not called if the whole game is destroyed. You can use Drop of course but it’s not usually much use since you don’t have a reference to the game or anything.
fn occultation_notify_hook(
&self,
_piece: PieceId
) -> Option<Box<dyn FnOnce(&'r mut PrepareUpdatesBuffer<'_>) + 'static, Global>>
[src]Trait Implementations
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]Serialize this value into the given Serde serializer. Read more
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]Serialize this value into the given Serde serializer. Read more
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]Serialize this value into the given Serde serializer. Read more
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]Serialize this value into the given Serde serializer. Read more
Implementors
pub fn svg_piece(
&self,
f: &mut Html,
gpc: &GPiece,
_gs: &GameState,
vpid: VisiblePieceId
) -> Result<(), InternalError>
[src]pub fn describe_html(
&self,
gpc: &GPiece,
_goccults: &GameOccults
) -> Result<Html, InternalError>
[src]pub fn svg_piece(
&self,
f: &mut Html,
gpc: &GPiece,
_gs: &GameState,
_vpid: VisiblePieceId
) -> Result<(), InternalError>
[src]pub fn describe_html(
&self,
gpc: &GPiece,
_goccults: &GameOccults
) -> Result<Html, InternalError>
[src]