mirror of
https://github.com/demostf/demo.js
synced 2026-06-04 09:04:13 +02:00
minor cleanup
This commit is contained in:
parent
a7911f2d3d
commit
2c8fe681d3
9 changed files with 93 additions and 54 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import {BitStream} from 'bit-buffer';
|
||||
import {Match} from '../../Data/Match';
|
||||
import {Packet, PacketType, VoidPacket} from '../../Data/Packet';
|
||||
import {Packet, VoidPacket} from '../../Data/Packet';
|
||||
|
||||
export type Parser<P extends Packet> = (stream: BitStream, match?: Match, skip?: boolean) => P;
|
||||
export type Encoder<P extends Packet> = (packet: P, stream: BitStream, match?: Match) => void;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import {Packet} from '../../Data/Packet';
|
||||
import {Packet, PacketType} from '../../Data/Packet';
|
||||
import {Encoder, PacketHandler, Parser} from './Parser';
|
||||
import {BitStream} from 'bit-buffer';
|
||||
|
||||
export function make<P extends Packet>(name: P['packetType'], definition: string): PacketHandler<P> {
|
||||
export function make<P extends Packet>(name: PacketType, definition: string): PacketHandler<P> {
|
||||
const parts = definition.split('}');
|
||||
const items = parts.map((part) => {
|
||||
return part.split('{');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue