getEventForState method

MatexCountryBlocEvent? getEventForState(
  1. MatexCountryBlocState state
)
inherited

Returns the event related to the given state.

Implementation

E? getEventForState(S state) {
  if (eventStateHistory.isEmpty ||
      eventStateHistorySize == 0 ||
      !enableForceBuildEvents) {
    return null;
  }

  for (final entry in eventStateHistory.entries) {
    final event = entry.key;
    final stateList = entry.value;

    if (stateList.contains(state.uuid)) {
      return event;
    }
  }

  return null;
}