private void PlayLastMoveMessages(HashSet <int> playersToMove, int startMsgIdx, int endMsgIdx) { if (startMsgIdx > endMsgIdx) { Debug.LogError("PlayLastMoveMessages: startIdx shouldn\'t be greater than endIdx"); return; } HashSet <int> handledPlayers = new HashSet <int>(); for (int i = endMsgIdx; i >= startMsgIdx; --i) { MsgData msg = messagesToPlay[i]; if (!handledPlayers.Contains(msg.id) && msg.IsPositionChange()) { PlayBackMsg(msg); handledPlayers.Add(msg.id); } if (playersToMove.Count == handledPlayers.Count) { return; } } }