public void DropAcceptedHandler(string oldContainerId, string newContainerId, ICheckerData data) { if (!(data is SimpleTextData)) { throw new ArgumentException("SimpleTextChecker expects data of type SimpleTextData"); } var d = data as SimpleTextData; if (!dict.ContainsKey(newContainerId)) { dict.Add(newContainerId, new List<string>()); } dict[newContainerId].Add(d.Text); if (oldContainerId == "default") { ++nrAcceptedDrops; } else { dict[oldContainerId].Remove(d.Text); } if (nrAcceptedDrops == NrAccepts) { // Check the result var r = CheckResults(); // Inform the game all drop are done OnTaskFinished(r); } }
public void DropAcceptedHandler(string oldContainerId, string newContainerId, ICheckerData data) { if (!(data is SimpleTextData)) { throw new ArgumentException("SimpleTextChecker expects data of type SimpleTextData"); } var d = data as SimpleTextData; if (!dict.ContainsKey(newContainerId)) { dict.Add(newContainerId, new List <string>()); } dict[newContainerId].Add(d.Text); if (oldContainerId == "default") { ++nrAcceptedDrops; } else { dict[oldContainerId].Remove(d.Text); } if (nrAcceptedDrops == NrAccepts) { // Check the result var r = CheckResults(); // Inform the game all drop are done OnTaskFinished(r); } }