Beispiel #1
0
    public virtual bool _Load(String path)
    {
        if (_data != null)
        {
            return(false);
        }

        _data = BBGame.Game().LoadData(path);
        if (_data == null)
        {
            return(false);
        }

        _length = _data.Length;
        return(true);
    }
Beispiel #2
0
    public virtual bool Open(String path, String mode)
    {
        if (_stream != null)
        {
            return(false);
        }

        FileMode fmode = 0;

        if (mode == "r")
        {
            fmode = FileMode.Open;
        }
        else if (mode == "w")
        {
            fmode = FileMode.Create;
        }
        else if (mode == "u")
        {
            fmode = FileMode.OpenOrCreate;
        }
        else
        {
            return(false);
        }

        _stream = BBGame.Game().OpenFile(path, fmode);
        if (_stream == null)
        {
            return(false);
        }

        _position = _stream.Position;
        _length   = _stream.Length;
        return(true);
    }