def_key: 'C',
opname: "deactivate".to_owned(),
desc: Html::lit("Deactivate hand"),
- wrc: WRC::UpdateSvg,
+ wrc: WRC::Unpredictable,
}}
else { UoDescription {
kind: UoKind:: Piece,
def_key: 'C',
opname: "claim".to_owned(),
desc: Html::lit("Claim this as your hand"),
- wrc: WRC::UpdateSvg,
+ wrc: WRC::Unpredictable,
}}
})
}
if (!(uo.kind == 'Global' || uo.kind == 'GlobalExtra' || uo.kind == 'Piece'))
throw 'bad kind '+uo.kind;
- if (uo.wrc == 'UpdateSvg' || uo.wrc == 'Predictable') {
- for (var piece of uo.targets!) {
- let p = pieces[piece]!;
- api_piece(api, 'k', piece, p, { opname: uo.opname, wrc: uo.wrc });
- if (uo.wrc == 'UpdateSvg') {
- p.cseq_updatesvg = p.cseq;
- redisplay_ancillaries(piece,p);
- }
+ for (var piece of uo.targets!) {
+ let p = pieces[piece]!;
+ api_piece(api, 'k', piece, p, { opname: uo.opname, wrc: uo.wrc });
+ if (uo.wrc == 'UpdateSvg') {
+ p.cseq_updatesvg = p.cseq;
+ redisplay_ancillaries(piece,p);
}
}
}
}
}
+messages.RecordedUnpredictable = <MessageHandler>function
+(j: { piece: PieceId, cseq: ClientSeq, ns: PreparedPieceState } ) {
+ let piece = j.piece;
+ let p = pieces[piece]!;
+ piece_modify(piece, p, j.ns, false);
+}
+
messages.Error = <MessageHandler>function
(m: any) {
console.log('ERROR UPDATE ', m);