From 18ba9fd568bf368bb9d2f132e9ca86e284567fbf Mon Sep 17 00:00:00 2001 From: Branden J Brown Date: Sat, 20 Jan 2024 23:56:03 -0600 Subject: [PATCH] move player id to a separate package Later, this package could hold stuff like MMR. It's just a type for now. --- game/player.go | 10 +++++----- player/player.go | 6 ++++++ 2 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 player/player.go diff --git a/game/player.go b/game/player.go index b15d796..1d156df 100644 --- a/game/player.go +++ b/game/player.go @@ -1,13 +1,13 @@ package game -import "slices" +import ( + "slices" -// PlayerID is a unique ID for a player. -// May just be IPv6 (or IPv4-in-6) of their connection, or a UUID. -type PlayerID [16]byte + "git.sunturtle.xyz/studio/shotgun/player" +) type Player struct { - ID PlayerID + ID player.ID HP int8 Items [8]Item Cuffs CuffState diff --git a/player/player.go b/player/player.go new file mode 100644 index 0000000..4fe3152 --- /dev/null +++ b/player/player.go @@ -0,0 +1,6 @@ +// Package player implements data about players outside games. +package player + +// ID is a unique ID for a player. +// May just be IPv6 (or IPv4-in-6) of their connection, or a UUID. +type ID [16]byte