mirror of
https://github.com/MaddyThorson/StrawberryBF.git
synced 2025-04-12 03:16:05 +08:00
37 lines
472 B
Brainfuck
37 lines
472 B
Brainfuck
using System;
|
|
using System.IO;
|
|
|
|
namespace Strawberry
|
|
{
|
|
public abstract class Asset
|
|
{
|
|
public readonly String Path;
|
|
|
|
protected this(String path)
|
|
{
|
|
Path = path;
|
|
}
|
|
|
|
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();
|
|
}
|
|
}
|
|
}
|