StrawberryBF/src/Assets/Asset.bf

37 lines
472 B
Brainfuck
Raw Normal View History

2020-06-15 11:48:01 +08:00
using System;
2020-06-15 15:56:01 +08:00
using System.IO;
2020-06-15 11:48:01 +08:00
namespace Strawberry
{
public abstract class Asset
{
public readonly String Path;
protected this(String path)
{
Path = path;
}
2020-06-15 15:56:01 +08:00
public ~this()
{
Unload();
}
protected mixin OpenFileStream()
{
let stream = scope:: FileStream();
stream.Open(Path, .Read, .Read);
stream
}
protected abstract void Load();
protected abstract void Unload();
public void Reload()
{
Unload();
Load();
}
2020-06-15 11:48:01 +08:00
}
}