Documentation ¶
Index ¶
- Constants
- Variables
- func NewCells(w, h int) (cells [][]Cell)
- type Appliable
- type Archetype
- type Armor
- func (a *Armor) GetArchetype() Archetype
- func (a *Armor) GetArchetypeID() id.UUID
- func (a Armor) GetPosition() Position
- func (a Armor) GetWID() id.WID
- func (a *Armor) SetArchetype(archetype Archetype)
- func (a *Armor) SetPosition(p Position)
- func (a *Armor) SetWID(wid id.WID)
- func (a Armor) Type() ObjectType
- type ArmorArchetype
- type ArmorType
- type Attribute
- type AttributeLevel
- type Attributes
- type BlockType
- type Blockable
- type Cell
- type Cells
- type Character
- func (c *Character) Apply(o Object, force bool) Event
- func (c *Character) Drop(o Object) Event
- func (c *Character) GetArchetype() Archetype
- func (c *Character) GetArchetypeID() id.UUID
- func (c Character) GetPosition() Position
- func (c Character) GetWID() id.WID
- func (c *Character) InInventory(wid id.WID) bool
- func (c *Character) Pickup(o Object) Event
- func (c *Character) SetArchetype(a Archetype)
- func (c *Character) SetPosition(p Position)
- func (c *Character) SetWID(wid id.WID)
- func (c Character) Type() ObjectType
- func (c *Character) Unapply(o Object, force bool) Event
- type CharacterArchetype
- type Damage
- type DamageResult
- type Damager
- type Desire
- type DesireApply
- type DesireBash
- type DesireDrop
- type DesireMove
- type DesireOpen
- type DesirePickup
- type DesireWrapper
- type Door
- type DoorArchetype
- type Event
- type EventAdd
- type EventApply
- type EventDamages
- type EventDrop
- type EventHealth
- type EventNotice
- type EventPickup
- type EventPosition
- type EventRemove
- type EventSound
- type EventTurn
- type EventWrapper
- type Health
- type Hurtable
- type Item
- type ItemArchetype
- type Location
- type Lockable
- type Movable
- type MoveDirection
- type MovementType
- type Object
- type ObjectType
- type ObjectWrapper
- type Objects
- func (o *Objects) Add(obj Object)
- func (o Objects) MarshalJSON() ([]byte, error)
- func (o Objects) MarshalMsgpack() ([]byte, error)
- func (o *Objects) ObjectByWID(wid id.WID) Object
- func (o *Objects) RemoveByWID(wid id.WID) Object
- func (o *Objects) UnmarshalJSON(b []byte) error
- func (o *Objects) UnmarshalMsgpack(b []byte) error
- type Openable
- type Position
- type RawMessage
- type Skills
- type Slot
- type SlotMap
- type Slots
- type TileArchetype
- type Trait
- type TraitClubber
- type TraitKungFu
- type TraitList
- type Weapon
- func (w *Weapon) GetArchetype() Archetype
- func (w *Weapon) GetArchetypeID() id.UUID
- func (w Weapon) GetPosition() Position
- func (w Weapon) GetWID() id.WID
- func (w *Weapon) SetArchetype(a Archetype)
- func (w *Weapon) SetPosition(p Position)
- func (w *Weapon) SetWID(wid id.WID)
- func (w Weapon) Type() ObjectType
- type WeaponArchetype
- type WeaponType
- type WorldInfo
Constants ¶
const ( AttributeSwoleDescription = "Swole determines damage and health" AttributeZoomsDescription = "Zooms determines speed and dodge" AttributeBrainsDescription = "Brains determines spell damage and ability to by-pass traps" AttributeFunkDescription = "Funk determines luck and area of effect bonuses" )
Variables ¶
var ( ColorSwole = color.NRGBA{128, 32, 32, 255} ColorSwoleVibrant = color.NRGBA{200, 100, 100, 255} ColorZooms = color.NRGBA{128, 128, 32, 255} ColorZoomsVibrant = color.NRGBA{200, 200, 100, 255} ColorBrains = color.NRGBA{32, 32, 128, 255} ColorBrainsVibrant = color.NRGBA{100, 100, 200, 255} ColorFunk = color.NRGBA{128, 32, 128, 255} ColorFunkVibrant = color.NRGBA{200, 100, 200, 255} )
var ( ErrAlreadyOpen = errors.New("it is already open") ErrAlreadyClosed = errors.New("it is already closed") )
var ( ErrMissingSlot = errors.New("missing slot") ErrMissingSlots = errors.New("missing slots") ErrUsedSlots = errors.New("used slots") )
var (
ErrInvalidBlockType = errors.New("invalid block type")
)
var (
ErrOutOfBoundCell = errors.New("oob cell")
)
Functions ¶
Types ¶
type Armor ¶
type Armor struct { Position Appliable ArchetypeID id.UUID `msgpack:"A,omitempty"` Archetype Archetype `msgpack:"-" json:"-"` WID id.WID Container id.WID `msgpack:"c,omitempty"` // The container of the item, if any. }
Armor is a weapon.
func (*Armor) GetArchetype ¶
GetArchetype returns the archetype.
func (*Armor) GetArchetypeID ¶
GetArchetypeID returns the ID of the archetype.
func (Armor) GetPosition ¶
GetPosition returns the position of the object.
func (*Armor) SetArchetype ¶
SetArchetype sets the archetype.
func (*Armor) SetPosition ¶
SetPosition sets the position of the object.
type ArmorArchetype ¶
type ArmorArchetype struct { ID id.UUID Title string Image string Description string ArmorType ArmorType MinArmor int // Character proficiency with a weapon increases min up to max. MaxArmor int MovePenalty int // Penalty to movement speed. Slots Slots `msgpack:"S,omitempty"` }
ArmorArchetype is effectively a blueprint for armour.
func (ArmorArchetype) GetID ¶
func (a ArmorArchetype) GetID() id.UUID
GetID returns the ID of the archetype.
func (ArmorArchetype) RangeString ¶
func (a ArmorArchetype) RangeString() string
RangeString returns the armor range of the archetype.
func (ArmorArchetype) Type ¶
func (a ArmorArchetype) Type() string
Type returns the type of the archetype.
type ArmorType ¶
type ArmorType uint8
ArmorType is the type the armor is considered as.
func (*ArmorType) UnmarshalJSON ¶
UnmarshalJSON unmarshals the JSON representation of the armor type.
type Attribute ¶
type Attribute uint8
Attribute represents a particular physical or mental ability of a character.
type AttributeLevel ¶
type AttributeLevel float64
AttributeLevel represents the level of an attribute, with the whole number representing the level and the fractional representing the experience until the next level.
type Attributes ¶
type Attributes struct { Swole AttributeLevel `msgpack:"s,omitempty"` Zooms AttributeLevel `msgpack:"z,omitempty"` Brains AttributeLevel `msgpack:"b,omitempty"` Funk AttributeLevel `msgpack:"f,omitempty"` }
type Cell ¶
type Cell struct { TileID *id.UUID `msgpack:"id,omitempty"` // The Tile ID of the cell. Blocks MovementType `msgpack:"b,omitempty"` // Whether the cell blocks. This should be generated from the TileID and the contained Objects. Objects Objects `msgpack:"o,omitempty"` // Non-thinking/active objects. These will generally be weapons, armor, gold, food, etc. // contains filtered or unexported fields }
type Character ¶
type Character struct { Position Blockable Hurtable Damager Movable Events []Event `msgpack:"-" json:"-"` // Events that have happened to the character. These are only sent to the owning client. Desire Desire `msgpack:"-" json:"-"` // The current desire of the character. Used server-side. LastDesire Desire `msgpack:"-" json:"-"` // Last desire processed. Used server-side. WID id.WID // ID assigned when entering da world. Archetype Archetype `msgpack:"-" json:"-"` // Archetype of the character. This is likely a pointer. ArchetypeID id.UUID `msgpack:"A,omitempty"` Name string `msgpack:"n,omitempty"` Level int `msgpack:"l,omitempty"` Attributes Attributes `msgpack:"t,omitempty"` Slots SlotMap `msgpack:"-"` Skills Skills `msgpack:"-"` Inventory Objects `msgpack:"-"` // SpentActions int }
Character represents a character. This can be a player or an NPC.
func (*Character) GetArchetype ¶
GetArchetype returns the archetype.
func (*Character) GetArchetypeID ¶
GetArchetypeID returns the archetype.
func (Character) GetPosition ¶
GetPosition returns the position.
func (*Character) InInventory ¶
InInventory returns true if the character has the object in their inventory.
func (*Character) SetArchetype ¶
SetArchetype sets the archetype.
func (*Character) SetPosition ¶
SetPosition sets the position.
type CharacterArchetype ¶
type CharacterArchetype struct { Title string `msgpack:"t,omitempty"` // Title of the archetype. This is what is displayed to the user. ID id.UUID `msgpack:"id,omitempty"` PlayerOnly bool // If the archetype is for players only during character creation. Image string `msgpack:"i,omitempty"` // Image for the archetype. Should be requested via HTTP to the resources backend. // Swole AttributeLevel // Raw Strength + Health Zooms AttributeLevel // Dex, basically Brains AttributeLevel // Thinkin' and spell-related Funk AttributeLevel // Charm and god-related //Traits []string // Traits Traits TraitList Slots Slots // Slots StartingObjects []id.UUID // Starting objects StartingSkills map[string]float64 // Starting skills }
CharacterArchetype is a structure that is used to act as a "template" for creating playable characters.
type Damage ¶
Damage represents the damage range of an attack.
func (Damage) RangeString ¶
RangeString returns a string representation of the damage range.
type DamageResult ¶
type DamageResult struct {
Damage int
}
DamageResult represents the result of a damage roll.
type Damager ¶
type Damager struct {
Damages []Damage
}
func (*Damager) CalculateFromCharacter ¶
func (*Damager) RollDamages ¶
func (d *Damager) RollDamages() (results []DamageResult)
type Desire ¶
type Desire interface {
Type() string
}
Desire represents a desire of the client to make their character do something. These often cause Events to be sent back to the client on location updating.
type DesireApply ¶
type DesireApply struct { WID id.WID `msgpack:"wid,omitempty"` Apply bool `msgpack:"a,omitempty"` // Whether to apply or unapply. }
DesireApply represents the desire to apply or unapply a particular object.
func (DesireApply) Type ¶
func (d DesireApply) Type() string
type DesireBash ¶
type DesireBash struct { WID id.WID `msgpack:"wid,omitempty"` Direction MoveDirection `msgpack:"d,omitempty"` }
DesireBash represents the desire to bash a particular object or direction.
func (DesireBash) Type ¶
func (d DesireBash) Type() string
type DesireDrop ¶
DesireDrop represents the desire to drop a particular object.
func (DesireDrop) Type ¶
func (d DesireDrop) Type() string
type DesireMove ¶
type DesireMove struct {
Direction MoveDirection `msgpack:"d,omitempty"`
}
DesireMove represents the desire to move in a cardinal direction.
func (DesireMove) Type ¶
func (d DesireMove) Type() string
type DesireOpen ¶
type DesireOpen struct { WID id.WID `msgpack:"wid,omitempty"` Open bool `msgpack:"o,omitempty"` // Whether to open or close. }
DesireOpen represents the desire to open or close a particular object.
func (DesireOpen) Type ¶
func (d DesireOpen) Type() string
type DesirePickup ¶
DesirePickup represents the desire to pick up a particular object.
func (DesirePickup) Type ¶
func (d DesirePickup) Type() string
type DesireWrapper ¶
type DesireWrapper struct { Type string `msgpack:"t"` Data msgpack.RawMessage `msgpack:"d"` }
DesireWrapper is for sending desires from the client to the server.
func (*DesireWrapper) Desire ¶
func (w *DesireWrapper) Desire() Desire
Desire returns the desire stored in the wrapper.
type Door ¶
type Door struct { Position Hurtable Lockable Blockable Openable ArchetypeID id.UUID `msgpack:"A,omitempty"` Archetype Archetype `msgpack:"-" json:"-"` WID id.WID // ID assigned when entering da world. }
Door is a door.
func (Door) GetArchetype ¶
GetArchetype returns the archetype of this object.
func (Door) GetArchetypeID ¶
GetArchetypeID returns the archetype ID of this object.
func (Door) GetPosition ¶
GetPosition returns the position of this object.
func (*Door) SetArchetype ¶
SetArchetype sets the archetype of this object.
func (*Door) SetPosition ¶
SetPosition sets the position of this object.
type DoorArchetype ¶
type DoorArchetype struct { ID id.UUID Title string `msgpack:"T,omitempty"` Image string `msgpack:"i,omitempty"` BlockType BlockType `msgpack:"-"` Health int `msgpack:"-"` MaxHealth int `msgpack:"-"` }
DoorArchetype is the archetype for a door.
func (DoorArchetype) GetID ¶
func (d DoorArchetype) GetID() id.UUID
GetID returns the ID of this archetype.
func (DoorArchetype) Type ¶
func (d DoorArchetype) Type() string
Type returns the type of this archetype.
type Event ¶
type Event interface {
Type() string
}
Event is the result of something happening on the server that is to be sent to the client. This includes sounds, position information, damage dealt, and more. Many events are as the result of client-sent Desires.
type EventAdd ¶
type EventAdd struct {
Object Object `msgpack:"o,omitempty"`
}
EventAdd adds the provided object.
func (EventAdd) MarshalMsgpack ¶
MarshalMsgpack marshals EventAdd into eventAdd.
func (*EventAdd) UnmarshalMsgpack ¶
UnmarshalMsgpack unmarshals EventAdd from eventAdd.
type EventApply ¶
type EventApply struct { Applier id.WID `msgpack:"A,omitempty"` WID id.WID Applied bool `msgpack:"a,omitempty"` }
EventApply notifies the client that the given item was applied or unapplied.
type EventDamages ¶
type EventDamages struct { From id.WID `msgpack:"f,omitempty"` Target id.WID `msgpack:"t,omitempty"` Damages []DamageResult `msgpack:"d,omitempty"` }
EventDamages notifies the client that the given object was damaged.
type EventDrop ¶
EventDrop notifies the client that the given item was dropped.
func (EventDrop) MarshalMsgpack ¶
MarshalMsgpack marshals EventDrop into eventDrop.
func (*EventDrop) UnmarshalMsgpack ¶
UnmarshalMsgpack unmarshals EventDrop from eventDrop.
type EventHealth ¶
type EventHealth struct { From id.WID `msgpack:"f,omitempty"` Target id.WID `msgpack:"t,omitempty"` Health int `msgpack:"h,omitempty"` }
EventHealth notifies the client that the given object's health changed.
type EventNotice ¶
type EventNotice struct {
Message string
}
EventNotice notifies the client of a generic notice.
type EventPickup ¶
EventPickup notifies the client that the given item was picked up.
type EventPosition ¶
EventPosition represents a position update of something in a world location.
type EventRemove ¶
EventRemove removes an object with the given WID from the current location.
type EventSound ¶
type EventSound struct { WID id.WID `msgpack:"wid,omitempty"` Position `msgpack:"p,omitempty"` FromPosition Position `msgpack:"f,omitempty"` Message string `msgpack:"m,omitempty"` }
EventSound represents a sound emitted from a location. FromX and FromY are used to modify the visual offset of the sound. This makes it so when you bump into a wall or hit an enemy, the sound effect appears between the two points.
type EventTurn ¶
type EventTurn struct {
Turn int `msgpack:"t,omitempty"`
}
EventTurn notifies the client that a location turn has occurred.
type EventWrapper ¶
type EventWrapper struct { Type string `msgpack:"t"` Data msgpack.RawMessage `msgpack:"d"` }
EventWrapper is for sending desires from the client to the server.
func WrapEvent ¶
func WrapEvent(e Event) (EventWrapper, error)
WrapEvent wraps up an event to be sent over the wire.
func (*EventWrapper) Event ¶
func (w *EventWrapper) Event() Event
Event returns the event stored in the wrapper.
type Hurtable ¶
type Hurtable struct { Health int `msgpack:"h,omitempty"` MaxHealth int `msgpack:"H,omitempty"` Downs int `msgpack:"d,omitempty"` MaxDowns int `msgpack:"D,omitempty"` }
func (*Hurtable) CalculateFromCharacter ¶
func (*Hurtable) CalculateFromObject ¶
func (*Hurtable) TakeDamages ¶
func (h *Hurtable) TakeDamages(damages []DamageResult)
type Item ¶
type Item struct { Position ArchetypeID id.UUID `msgpack:"A,omitempty"` Archetype Archetype `msgpack:"-" json:"-"` WID id.WID // ID assigned when entering da world. Container id.WID `msgpack:"c,omitempty"` // The container of the item, if any. ID id.UUID `msgpack:"id,omitempty"` Name string `msgpack:"n,omitempty"` }
Item represents a generic item in the world.
func (*Item) GetArchetype ¶
func (*Item) GetArchetypeID ¶
func (Item) GetPosition ¶
GetPosition returns the position of the item.
func (*Item) SetArchetype ¶
func (*Item) SetPosition ¶
SetPosition sets the position of the item.
type ItemArchetype ¶
type ItemArchetype struct { ID id.UUID Title string `msgpack:"T,omitempty"` Image string `msgpack:"i,omitempty"` }
ItemArchetype is effectively a blueprint for an item.
func (ItemArchetype) GetID ¶
func (a ItemArchetype) GetID() id.UUID
func (ItemArchetype) Type ¶
func (a ItemArchetype) Type() string
type Location ¶
type Location struct { ID id.UUID `msgpack:"id,omitempty"` Cells Cells `msgpack:"c,omitempty"` Objects Objects `msgpack:"o,omitempty"` }
func (*Location) Characters ¶
type Lockable ¶
type Lockable struct {
Locked bool `msgpack:"l"`
}
Lockable is a feature that enables locking and unlocking
type Movable ¶
type Movable struct {
Actions int `msgpack:"s"` // Amount of actions taken in a turn. This will generally be 1 for each player.
}
func (*Movable) CalculateFromCharacter ¶
type MoveDirection ¶
type MoveDirection uint8
const ( UpMoveDirection MoveDirection = 8 LeftMoveDirection MoveDirection = 4 RightMoveDirection MoveDirection = 6 DownMoveDirection MoveDirection = 2 UpLeftMoveDirection MoveDirection = 7 UpRightMoveDirection MoveDirection = 9 DownRightMoveDirection MoveDirection = 3 DownLeftMoveDirection MoveDirection = 1 CenterMoveDirection MoveDirection = 5 )
func (MoveDirection) Position ¶
func (d MoveDirection) Position() (int, int)
type MovementType ¶
type MovementType uint8
TODO: Replace MovementType with bitflag
const ( MovementNone MovementType = iota MovementAll MovementWalk MovementSwim MovementHover MovementFly )
type Object ¶
type Object interface { Type() ObjectType SetWID(id.WID) // SetWID should only be called by the world. GetWID() id.WID SetPosition(Position) GetPosition() Position GetArchetypeID() id.UUID SetArchetype(a Archetype) GetArchetype() Archetype }
Object is an interface intended for location objects. This includes players, items, and enemies.
type ObjectType ¶
type ObjectType string
ObjectType is a key that represents an object's type. This is used for safely marshalling/unmarshalling the Object interface.
type ObjectWrapper ¶
type ObjectWrapper struct { Type ObjectType `msgpack:"t"` Data RawMessage `msgpack:"d"` }
ObjectWrapper wraps an Object interface for msgpack marshal and unmarshal.
func (ObjectWrapper) Object ¶
func (ow ObjectWrapper) Object() (Object, error)
Object returns the wrapped Object. To add additional types, they must be handled here and ObjectJSON.
func (ObjectWrapper) ObjectJSON ¶
func (ow ObjectWrapper) ObjectJSON() (Object, error)
ObjectJSON returns the wrapped Object. To add additional types, they must be handled here and Object.
type Objects ¶
type Objects []Object
Objects is a slice of Object interfaces. This type wrapper provides various convenience functions for accessing and modifying the slice.
func (Objects) MarshalJSON ¶
MarshalJSON returns bytes as an ObjectsWrapper.
func (Objects) MarshalMsgpack ¶
MarshalMsgpack returns bytes as an ObjectsWrapper.
func (*Objects) ObjectByWID ¶
ObjectByWID returns an object by its WID.
func (*Objects) RemoveByWID ¶
RemoveByWID removes a stored object by its WID.
func (*Objects) UnmarshalJSON ¶
UnmarshalJSON unmarshals the given bytes as an ObjectsWrapper and appends objects into the slice.
func (*Objects) UnmarshalMsgpack ¶
UnmarshalMsgpack unmarshals the given bytes as an ObjectsWrapper and appends objects into the slice.
type RawMessage ¶
type RawMessage []byte
func (RawMessage) MarshalJSON ¶
func (m RawMessage) MarshalJSON() ([]byte, error)
func (RawMessage) MarshalMsgpack ¶
func (m RawMessage) MarshalMsgpack() ([]byte, error)
func (*RawMessage) UnmarshalJSON ¶
func (m *RawMessage) UnmarshalJSON(b []byte) error
func (*RawMessage) UnmarshalMsgpack ¶
func (m *RawMessage) UnmarshalMsgpack(b []byte) error
type SlotMap ¶
SlotMap is a map of slots used by characters.
func (SlotMap) Apply ¶
Apply adds the given slots to the slot map. If any slots are missing, an error will instead be returned.
func (SlotMap) AreSlotsOpen ¶
AreSlotsOpen returns nil if all of the slots in the slot map are open. Returns ErrUsedSlots wrapping a list of used slots otherwise.
type Slots ¶
type Slots []Slot
Slots is a slice of slots used for equipment.
type TileArchetype ¶
type TileArchetype struct { Title string ID id.UUID Image string // Image for the tile. It should be requested via HTTP to the resources backend. }
TileArchetype is a structure that is used to provide the behavior and appearance of a given cell.
func (TileArchetype) GetID ¶
func (a TileArchetype) GetID() id.UUID
func (TileArchetype) Type ¶
func (a TileArchetype) Type() string
type TraitClubber ¶
type TraitClubber struct { }
func (TraitClubber) AdjustDamages ¶
func (t TraitClubber) AdjustDamages(damages []Damage) []Damage
func (TraitClubber) CanApply ¶
func (t TraitClubber) CanApply(o Object) bool
func (TraitClubber) String ¶
func (t TraitClubber) String() string
type TraitKungFu ¶
type TraitKungFu struct { }
func (TraitKungFu) AdjustDamages ¶
func (t TraitKungFu) AdjustDamages(damages []Damage) []Damage
func (TraitKungFu) CanApply ¶
func (t TraitKungFu) CanApply(o Object) bool
func (TraitKungFu) String ¶
func (t TraitKungFu) String() string
type TraitList ¶
type TraitList []Trait
func (TraitList) MarshalMsgpack ¶
func (*TraitList) UnmarshalJSON ¶
func (*TraitList) UnmarshalMsgpack ¶
type Weapon ¶
type Weapon struct { Position Appliable ArchetypeID id.UUID `msgpack:"A,omitempty"` Archetype Archetype `msgpack:"-" json:"-"` WID id.WID Container id.WID `msgpack:"c,omitempty"` // The container of the item, if any. }
Weapon is a weapon.
func (*Weapon) GetArchetype ¶
GetArchetype returns the archetype.
func (*Weapon) GetArchetypeID ¶
GetArchetypeID returns the ID of the archetype.
func (Weapon) GetPosition ¶
GetPosition returns the position of the item.
func (*Weapon) SetArchetype ¶
SetArchetype sets the archetype.
func (*Weapon) SetPosition ¶
SetPosition sets the position of the item.
type WeaponArchetype ¶
type WeaponArchetype struct { ID id.UUID Title string `msgpack:"T,omitempty"` Image string `msgpack:"i,omitempty"` PrimaryAttribute Attribute `msgpack:"p,omitempty"` // Primary attribute to draw damage from. SecondaryAttribute Attribute `msgpack:"s,omitempty"` // Secondary attribute to draw 50% damage from. Description string `msgpack:"d,omitempty"` WeaponType WeaponType `msgpack:"w,omitempty"` MinDamage int `msgpack:"m,omitempty"` // Character proficiency with a weapon increases min up to max. MaxDamage int `msgpack:"M,omitempty"` Slots Slots `msgpack:"S,omitempty"` }
WeaponArchetype is effectively a blueprint for a weapon.
func (WeaponArchetype) GetID ¶
func (a WeaponArchetype) GetID() id.UUID
GetID returns the ID of the archetype.
func (WeaponArchetype) RangeString ¶
func (a WeaponArchetype) RangeString() string
RangeString returns the string representation of the damage range.
func (WeaponArchetype) Type ¶
func (a WeaponArchetype) Type() string
Type returns the type of the archetype.
type WeaponType ¶
type WeaponType uint8
WeaponType is the type the weapon is considered as.
const ( WeaponTypeNone WeaponType = iota WeaponTypeMelee WeaponTypeRange WeaponTypeThrown WeaponTypeUnarmed )
func (WeaponType) Color ¶
func (a WeaponType) Color() color.Color
Color returns the color associated with the weapon type.
func (WeaponType) String ¶
func (a WeaponType) String() string
String returns the string representation of the weapon type.
func (*WeaponType) UnmarshalJSON ¶
func (a *WeaponType) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the JSON representation of the weapon type.