[cardcity] service drafts
[myCabin.git] / src / func.xyz / cardcity / internal / dao / castle.go
blob6efd7dcf488d0d35bd30824231ff519ee2551886
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.
5 package dao
7 import (
8 "func.xyz/cardcity/model"
11 type CityHeader struct {
12 ID model.Coord
13 Radius int
15 Name string
16 OwnerID string
17 FriendIDs []string
20 type City struct {
21 CityHeader
22 Inventory []*model.Object
23 Flowout []*model.Object
25 db *Database
28 func (db *Database) NewCity() *City {
29 return &City{
30 db: db,
34 func (db *Database) GetCity(id model.Coord) (*City, error) {
35 // TODO
36 return nil, nil
39 func (db *Database) DropCity(id model.Coord) error {
40 // TODO
41 return nil
44 func (db *Database) ListCitiesByOwner(id string) ([]CityHeader, error) {
45 // TODO
46 return nil, nil
49 func (db *Database) ListCitiesOnLine(start, stop model.Coord) ([]CityHeader, error) {
50 // TODO
51 return nil, nil
54 func (city *City) Save() error {
55 // TODO
56 return nil
59 func (city *City) Drop() error {
60 return city.db.DropCity(city.ID)