1 // Copyright (c) 2024 Jack J. Mao All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
8 "func.xyz/cardcity/model"
11 type CityHeader
struct {
22 Inventory
[]*model
.Object
23 Flowout
[]*model
.Object
28 func (db
*Database
) NewCity() *City
{
34 func (db
*Database
) GetCity(id model
.Coord
) (*City
, error
) {
39 func (db
*Database
) DropCity(id model
.Coord
) error
{
44 func (db
*Database
) ListCitiesByOwner(id
string) ([]CityHeader
, error
) {
49 func (db
*Database
) ListCitiesOnLine(start
, stop model
.Coord
) ([]CityHeader
, error
) {
54 func (city
*City
) Save() error
{
59 func (city
*City
) Drop() error
{
60 return city
.db
.DropCity(city
.ID
)