-
Notifications
You must be signed in to change notification settings - Fork 4
/
ally-shoot-packet.ts
46 lines (41 loc) · 1.11 KB
/
ally-shoot-packet.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { Writer } from '../../writer';
import { Reader } from '../../reader';
import { PacketType } from '../../packet-type';
import { Packet } from '../../packet';
/**
* Received when another player shoots a projectile.
*/
export class AllyShootPacket implements Packet {
type = PacketType.ALLYSHOOT;
propagate = true;
//#region packet-specific members
/**
* The bullet id of the projectile which was produced.
*/
bulletId: number;
/**
* The object id of the player who fired the projectile.
*/
ownerId: number;
/**
* The item id of the weapon used to fire the projectile.
*/
containerType: number;
/**
* The angle at which the projectile was fired.
*/
angle: number;
//#endregion
read(reader: Reader): void {
this.bulletId = reader.readUnsignedByte();
this.ownerId = reader.readInt32();
this.containerType = reader.readShort();
this.angle = reader.readFloat();
}
write(writer: Writer): void {
writer.writeUnsignedByte(this.bulletId);
writer.writeInt32(this.ownerId);
writer.writeShort(this.containerType);
writer.writeFloat(this.angle);
}
}