Otter  0.9.8.91
2d Game Development Framework based on SFML.Net
 All Classes Namespaces Functions Variables Enumerations Properties
Otter.Files Class Reference

Manages files used for game assets. Can use a packed data file of paths and byte arrays. The game will attempt to use local files before the packed data file. Packed data is expected as: bool: true to continue reading, false to stop string: the path of the file that was packed int32: the size of the file that was packed bytes: the actual data from the file More...

Static Public Member Functions

static void LoadPackedData (string path)
 Reads data from a uncompressed packed file More...
 
static bool FileExists (string path)
 Check if a file exists, or if it has been loaded from the packed data. More...
 
static Stream LoadFileStream (string path)
 Load a file as a memory stream from local files or packed data. Probably don't use this a lot it probably is memory leak city. More...
 
static byte[] LoadFileBytes (string path)
 Load a file as a byte array from local files or packed data. More...
 
static bool IsUsingDataPack (string path)
 Check if a file is being loaded from a local file or the packed data. Note that the game will attempt to load from local files before packed data. More...
 

Static Public Attributes

static Dictionary< string, byte[]> Data = new Dictionary<string, byte[]>()
 The unpacked data from a packed data file. File paths mapped to byte arrays. More...
 
static string AssetsFolderPrefix = "Assets/"
 

Detailed Description

Manages files used for game assets. Can use a packed data file of paths and byte arrays. The game will attempt to use local files before the packed data file. Packed data is expected as: bool: true to continue reading, false to stop string: the path of the file that was packed int32: the size of the file that was packed bytes: the actual data from the file

Member Function Documentation

static bool Otter.Files.FileExists ( string  path)
static

Check if a file exists, or if it has been loaded from the packed data.

Parameters
pathThe path to check.
Returns
True if the file exists or if it has been loaded from the packed data.
static bool Otter.Files.IsUsingDataPack ( string  path)
static

Check if a file is being loaded from a local file or the packed data. Note that the game will attempt to load from local files before packed data.

Parameters
pathThe path to check.
Returns
True if the data is coming from the packed file.
static byte [] Otter.Files.LoadFileBytes ( string  path)
static

Load a file as a byte array from local files or packed data.

Parameters
pathThe path to load from.
Returns
The byte array of the data from the file.
static Stream Otter.Files.LoadFileStream ( string  path)
static

Load a file as a memory stream from local files or packed data. Probably don't use this a lot it probably is memory leak city.

Parameters
pathThe path to load from.
Returns
The stream.
static void Otter.Files.LoadPackedData ( string  path)
static

Reads data from a uncompressed packed file

Parameters
pathThe path to the packed data file.

Member Data Documentation

Dictionary<string, byte[]> Otter.Files.Data = new Dictionary<string, byte[]>()
static

The unpacked data from a packed data file. File paths mapped to byte arrays.


The documentation for this class was generated from the following file: