void Update() { int id = previousSelectedAction ? previousSelectedAction.GetInstanceID() : -1; CardModel currentSelectedAction = playerMonstersModel.getNewestSelectedActionModel(id); if (!currentSelectedAction) { return; } checkDifferentActionIsSelected(currentSelectedAction); }
private bool isCurrentSelectedDifferent(CardModel currentSelectedAction) { if (!currentSelectedAction) { return(false); } if (!previousSelectedAction) { return(true); } return(currentSelectedAction.GetInstanceID() != previousSelectedAction.GetInstanceID()); }
private void checkIfSelectedActionChanged() { if (!cardWithAppliedManeuver) { return; } CardModel currentSelection = playerMonstersModel.getCurrentSelectedAction(); if (!currentSelection && model.IsApplied) { model.unapply(); return; } if (!currentSelection) { return; } if (cardWithAppliedManeuver.GetInstanceID() != currentSelection.GetInstanceID()) { cardWithAppliedManeuver = null; model.unapply(); } }