Exemplo n.º 1
0
    private byte[] EngineReadFileProxy(string filePath)
    {
        try
        {
            // Todo: load from bundle
#if LoadDataTableFromCache
            filePath = Path.GetFullPath(filePath).ToLower();
            byte[] bytes;
            if (CachedTables.TryGetValue(filePath, out bytes))
            {
                return(bytes);
            }
            else
            {
                return(null);
            }
#else
            byte[] buffer = null;
            buffer = File.ReadAllBytes(filePath);
            return(buffer);
#endif
        }
        catch (Exception e)
        {
            LogicSystem.LogErrorFromGfx("Exception:{0}\n{1}", e.Message, e.StackTrace);
            return(null);
        }
    }
Exemplo n.º 2
0
    private bool EngineFileExistsProxy(string filePath)
    {
        // TODO: handle bundle
#if LoadDataTableFromCache
        filePath = Path.GetFullPath(filePath).ToLower();
        byte[] bytes;
        return(CachedTables.TryGetValue(filePath, out bytes));
#else
        return(File.Exists(filePath));
#endif
    }