generate characters with sane compile time/memory
This commit is contained in:
@@ -20,6 +20,9 @@ var characterAffinity3SQL string
|
||||
type Character struct {
|
||||
ID int
|
||||
Name string
|
||||
// For internal use, the index of the character.
|
||||
// We don't show this in public API, but it lets us use vectors for lookups.
|
||||
Index int
|
||||
}
|
||||
|
||||
func Characters(ctx context.Context, db *sqlitex.Pool) ([]Character, error) {
|
||||
@@ -44,8 +47,9 @@ func Characters(ctx context.Context, db *sqlitex.Pool) ([]Character, error) {
|
||||
break
|
||||
}
|
||||
c := Character{
|
||||
ID: stmt.ColumnInt(0),
|
||||
Name: stmt.ColumnText(1),
|
||||
ID: stmt.ColumnInt(0),
|
||||
Name: stmt.ColumnText(1),
|
||||
Index: stmt.ColumnInt(2),
|
||||
}
|
||||
r = append(r, c)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user