Trait otter::gamestate::PieceTrait [−][src]
pub trait PieceTrait: OutlineTrait + Send + Debug + 'static + Serialize + Deserialize { fn nfaces(&self) -> RawFaceId; fn svg_piece(
&self,
f: &mut Html,
gpc: &GPiece,
gs: &GameState,
id: VisiblePieceId
) -> Result<(), IE>; fn describe_html(
&self,
gpc: &GPiece,
_goccults: &GameOccults
) -> Result<Html, IE>; fn itemname(&self) -> &str; fn add_ui_operations(
&self,
_: ShowUnocculted,
_upd: &mut Vec<UoDescription>,
_gs: &GameState,
_gpc: &GPiece
) -> Result<(), InternalError> { ... } fn ui_operation(
&self,
_: ShowUnocculted,
_a: ApiPieceOpArgs<'_>,
_opname: &str,
_wrc: WhatResponseToClientOp
) -> Result<UpdateFromOpComplex, ApiPieceOpError> { ... } fn held_change_hook(
&self,
_ig: &InstanceRef,
_gpieces: &mut GPieces,
_piece: PieceId,
_was_held: Option<PlayerId>
) -> Result<UnpreparedUpdates, IE> { ... } fn loaded_hook(
&self,
_piece: PieceId,
_gs: &mut GameState,
_ig: &InstanceRef
) -> Result<(), IE> { ... } fn delete_hook(
&self,
_p: &GPiece,
_gs: &mut GameState
) -> ExecuteGameChangeUpdates { ... } fn sortkey(&self) -> Option<&str> { ... } fn occultation_notify_hook(&self, _piece: PieceId) -> UnpreparedUpdates { ... } fn abs_bbox(&self, p: &GPiece) -> Result<Rect, IE> { ... } }
Required methods
fn svg_piece(
&self,
f: &mut Html,
gpc: &GPiece,
gs: &GameState,
id: VisiblePieceId
) -> Result<(), IE>
[src]fn describe_html(
&self,
gpc: &GPiece,
_goccults: &GameOccults
) -> Result<Html, IE>
[src]Provided methods
fn add_ui_operations(
&self,
_: ShowUnocculted,
_upd: &mut Vec<UoDescription>,
_gs: &GameState,
_gpc: &GPiece
) -> Result<(), InternalError>
[src]fn ui_operation(
&self,
_: ShowUnocculted,
_a: ApiPieceOpArgs<'_>,
_opname: &str,
_wrc: WhatResponseToClientOp
) -> Result<UpdateFromOpComplex, ApiPieceOpError>
[src]fn held_change_hook(
&self,
_ig: &InstanceRef,
_gpieces: &mut GPieces,
_piece: PieceId,
_was_held: Option<PlayerId>
) -> Result<UnpreparedUpdates, IE>
[src]
fn held_change_hook(
&self,
_ig: &InstanceRef,
_gpieces: &mut GPieces,
_piece: PieceId,
_was_held: Option<PlayerId>
) -> Result<UnpreparedUpdates, IE>
[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<(), IE>
[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) -> UnpreparedUpdates
[src]