Esempio n. 1
0
    private EnumPlayError Load()
    {
        if (!File.Exists(path))
        {
            return(EnumPlayError.FileDontExits);
        }
        if (!path.EndsWith(RecordFileSuffix))
        {
            return(EnumPlayError.FileTypeError);
        }
        try
        {
            var stream = File.OpenRead(path);
            stream.Seek(0, SeekOrigin.Begin);
            string time;
            stream.Read(out time);
            string t;
            stream.Read(out t);
            var dataType = Type.GetType(t);
            GameRecordDataHandle = GameRecorder.CreateRecodeData(dataType);
            GameRecordDataHandle?.Load(stream);
            stream.Close();
        }
        catch (Exception e)
        {
            Logger.LogError(e.ToString());
        }

        if (GameRecordDataHandle?.CommandsCount == 0)
        {
            return(EnumPlayError.FileContentError);
        }

        return(EnumPlayError.None);
    }
Esempio n. 2
0
 public bool InstanceHandle <T>() where T : IGameRecordData
 {
     GameRecordDataHandle = CreateRecodeData <T>();
     return(GameRecordDataHandle != null);
 }
Esempio n. 3
0
 public LoadParamRecoverTeam(IGameRecordData rData)
 {
     data = rData as GameRecordDataTeam;
 }