public WS_ObjectData GetObjectDataById(int id) { WS_ObjectData od = null; if (objectsDataDictionary.TryGetValue(id, out od)) { return(od); } return(null); }
protected void ObjectSelected(WS_ObjectData od) { if (look) { return; // this is because the function call from an Update function } look = true; if (currentObjectId == od.ID && GetObjectDataById(od.ID) != null) { currentObjectId = -1; objectsDataDictionary.Remove(od.ID); numOfPoints += od.Points; uiManager.StopTimer(); uiManager.ScoreUpdate(od.Points); } look = false; }
protected void SetNextObject() { WS_ObjectData od = null; if (objectsDataDictionary.Count == 0) { //TODO return; } foreach (int key in objectsDataDictionary.Keys) { currentObjectId = key; } if (objectsDataDictionary.TryGetValue(currentObjectId, out od)) { uiManager.SetTimer(od.Seconds); uiManager.ShowTheNextObject(od.ObjectIDentifeir, 5); } }
public void AddObjectData(WS_ObjectData od) { numOfPoints += od.Points; objectsDataDictionary.Add(od.ID, od); }