Exemplo n.º 1
0
        public void SavePuzzleData(int tower, int floor, double elapsedTime, ServerWriter.JobCompleteDelegate jobCompleteCB)
        {
            bool updateExistingFloor = false;

            foreach (TowerFloorRecord tfr in TheGameInfo.TowerData[tower].Floors)
            {
                if (tfr.Floor == floor)
                {
                    if (tfr.BestTime > elapsedTime)
                    {
                        tfr.BestTime = (int)elapsedTime;
                    }
                    updateExistingFloor = true;
                    break;
                }
            }
            if (!updateExistingFloor)
            {
                // Floor isnt in the local list, add it now
                List <TowerFloorRecord> records = new List <TowerFloorRecord>(TheGameInfo.TowerData[tower].Floors);
                TowerFloorRecord        tfr     = new TowerFloorRecord();
                tfr.Floor    = floor;
                tfr.BestTime = (int)elapsedTime;
                records.Add(tfr);
                TheGameInfo.TowerData[tower].Floors = records.ToArray();
            }

            m_ServerWriter.SavePuzzleData(TheGameInfo, tower, floor, elapsedTime, ExpSlowdown, jobCompleteCB);
        }
Exemplo n.º 2
0
 public SW_SavePuzzleJob(GameInfo gi, int tower, int floor, float completionTime, bool noExpBonus, ServerWriter.JobCompleteDelegate jobFinishedCB) : base("SW_SavePuzzleJob")
 {
     _gi             = gi;
     _tower          = tower;
     _floor          = floor;
     _completionTime = completionTime;
     _jobsDone       = jobFinishedCB;
     _noExpBonus     = noExpBonus;
 }