Ejemplo n.º 1
0
        public void _AddMount(string _MountName, UploadID _Uploader, VF.SQLPlayerID?_PlayerID = null, Func <int, VF.SQLUploadID> _GetSQLUploadIDFunc = null)
        {
            if (_PlayerID.HasValue && _PlayerID.Value.IsValid() && _GetSQLUploadIDFunc != null)
            {
                using (VF.SQLComm comm = new VF.SQLComm())
                {
                    int mountID = comm.GenerateMountID(_MountName);
                    if (mountID > 0)
                    {
                        comm.AddPlayerMount(_PlayerID.Value, _GetSQLUploadIDFunc(0), _Uploader.GetTime(), mountID);
                    }
                }
            }

            var mountIndex = Mounts.FindIndex((_Value) => _Value.Mount == _MountName);

            if (mountIndex != -1)
            {
                Mounts[mountIndex].AddUploader(_Uploader);
            }
            else
            {
                Mounts.Add(new MountData(_MountName, _Uploader));
            }
        }