GraphQL API and utilities for the rpdata project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
593 B

  1. package models
  2. // Character is a common data model representing an RP character or NPC.
  3. type Character struct {
  4. ID string `json:"id" bson:"_id"`
  5. Nicks []string `json:"nicks" bson:"nicks"`
  6. Name string `json:"name" bson:"name"`
  7. ShortName string `json:"shortName" bson:"shortName"`
  8. Author string `json:"author" bson:"author"`
  9. Description string `json:"description" bson:"description"`
  10. }
  11. // Nick gets the character's nick.
  12. func (character *Character) Nick() *string {
  13. if len(character.Nicks[0]) == 0 {
  14. return nil
  15. }
  16. return &character.Nicks[0]
  17. }