Skip to content

HylianBasement/rbx-bitbuffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BitBuffer

Typings for rstk's BitBuffer module.

Installation

npm i @rbxts/bitbuffer2

Usage

import BitBuffer from "@rbxts/bitbuffer2";

class PlayerData {
        public Money: number;

        public Experience: number;

        public AverageFps: number;

        public CustomName: string;

        public constructor(serialized?: string) {
                const buffer = BitBuffer.FromBase91(serialized);

                this.Money = buffer.ReadUInt(32);
                this.Experience = buffer.ReadUInt(16);
                this.AverageFps = buffer.ReadFloat32();
		this.CustomName = buffer.ReadString();
        }

        public Serialize() {
                const buffer = new BitBuffer();

                buffer.WriteUInt(32, this.Money);
                buffer.WriteUInt(16, this.Experience);
                buffer.WriteFloat32(this.AverageFps);
                buffer.WriteString(this.CustomName);

                return buffer.ToBase91();
        }
}

export = PlayerData;

About

Typings for rstk's BitBuffer module

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages