public void onAttrChange(PieceAttributeChangeModel m) { addGenericHistory(m.pieceId, m.activatingPieceId); }
public void onAttrChange(PieceAttributeChangeModel attrChange) { var piece = pieces.Piece(attrChange.pieceId); if(piece == null) return; var view = piece.pieceView; if(attrChange.pieceId != view.piece.id) return; //we don't actually know change in this case, but pass in -1 to always show //the punch size if (attrChange.attack != null || attrChange.baseAttack != null) { animationQueue.Add( new PieceView.UpdateTextAnim() { text = view.attackText, textGO = view.attackGO, current = view.piece.attack, original = view.piece.baseAttack, change = -1, animFinished = pieceTextAnimFinished, piece = view.piece } ); } if (attrChange.health != null || attrChange.baseHealth != null) { animationQueue.Add( new PieceView.UpdateTextAnim() { text = view.healthText, textGO = view.healthGO, current = view.piece.health, original = view.piece.baseHealth, change = -1, animFinished = pieceTextAnimFinished, piece = view.piece } ); } animationQueue.Add( new PieceView.UpdateHpBarAnim() { piece = view } ); }