Documentation ¶
Index ¶
- Variables
- func IsCollidable(t Terrain) bool
- type App
- type Coordinate
- func (*Coordinate) Descriptor() ([]byte, []int)
- func (this *Coordinate) Equal(that interface{}) bool
- func (m *Coordinate) GetDirection() geometry.Vec3
- func (m *Coordinate) GetPosition() geometry.Vec3
- func (m *Coordinate) GetTS() uint64
- func (this *Coordinate) GoString() string
- func (m *Coordinate) Marshal() (dAtA []byte, err error)
- func (m *Coordinate) MarshalTo(dAtA []byte) (int, error)
- func (m *Coordinate) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Coordinate) ProtoMessage()
- func (m *Coordinate) Reset()
- func (m *Coordinate) Size() (n int)
- func (this *Coordinate) String() string
- func (m *Coordinate) Unmarshal(dAtA []byte) error
- func (m *Coordinate) XXX_DiscardUnknown()
- func (m *Coordinate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Coordinate) XXX_Merge(src proto.Message)
- func (m *Coordinate) XXX_Size() int
- func (m *Coordinate) XXX_Unmarshal(b []byte) error
- type FilterCoordinate
- type FilterSector
- type FilterTileSet
- type FilterWorld
- type Orientation
- type Path
- type Platform
- type Sector
- func (*Sector) Descriptor() ([]byte, []int)
- func (this *Sector) Equal(that interface{}) bool
- func (m *Sector) GetAdjacents() map[string]geometry.Vec3
- func (m *Sector) GetDim() geometry.Vec3
- func (m *Sector) GetTileMap() TileMap
- func (this *Sector) GoString() string
- func (m *Sector) Marshal() (dAtA []byte, err error)
- func (m *Sector) MarshalTo(dAtA []byte) (int, error)
- func (m *Sector) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Sector) ProtoMessage()
- func (m *Sector) Reset()
- func (m *Sector) Size() (n int)
- func (this *Sector) String() string
- func (m *Sector) Unmarshal(dAtA []byte) error
- func (m *Sector) XXX_DiscardUnknown()
- func (m *Sector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Sector) XXX_Merge(src proto.Message)
- func (m *Sector) XXX_Size() int
- func (m *Sector) XXX_Unmarshal(b []byte) error
- type Sectors
- type Shape
- type StoreCoordinate
- type StoreSector
- type StoreTileSet
- type StoreWorld
- type Terrain
- type TileMap
- func (*TileMap) Descriptor() ([]byte, []int)
- func (this *TileMap) Equal(that interface{}) bool
- func (tm *TileMap) GeneratePaths(ps []Platform, n, variance, width, widthVariance uint64)
- func (tm *TileMap) GeneratePlatforms(n, size, variance uint64) []Platform
- func (m *TileMap) GetDim() geometry.Vec3
- func (m *TileMap) GetMap() []Terrain
- func (m *TileMap) GetSet() TileSet
- func (this *TileMap) GoString() string
- func (m *TileMap) Marshal() (dAtA []byte, err error)
- func (m *TileMap) MarshalTo(dAtA []byte) (int, error)
- func (m *TileMap) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*TileMap) ProtoMessage()
- func (m *TileMap) Reset()
- func (tm TileMap) SectorBreaks(dim geometry.Vec3) []Sector
- func (m *TileMap) Size() (n int)
- func (this *TileMap) String() string
- func (m *TileMap) Unmarshal(dAtA []byte) error
- func (m *TileMap) XXX_DiscardUnknown()
- func (m *TileMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TileMap) XXX_Merge(src proto.Message)
- func (m *TileMap) XXX_Size() int
- func (m *TileMap) XXX_Unmarshal(b []byte) error
- type TileSet
- func (*TileSet) Descriptor() ([]byte, []int)
- func (this *TileSet) Equal(that interface{}) bool
- func (m *TileSet) GetName() string
- func (m *TileSet) GetSize_() uint64
- func (m *TileSet) GetTerrains() map[int32]uint64
- func (m *TileSet) GetX() uint64
- func (m *TileSet) GetY() uint64
- func (this *TileSet) GoString() string
- func (m *TileSet) Marshal() (dAtA []byte, err error)
- func (m *TileSet) MarshalTo(dAtA []byte) (int, error)
- func (m *TileSet) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*TileSet) ProtoMessage()
- func (m *TileSet) Reset()
- func (m *TileSet) Size() (n int)
- func (this *TileSet) String() string
- func (m *TileSet) Unmarshal(dAtA []byte) error
- func (m *TileSet) XXX_DiscardUnknown()
- func (m *TileSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TileSet) XXX_Merge(src proto.Message)
- func (m *TileSet) XXX_Size() int
- func (m *TileSet) XXX_Unmarshal(b []byte) error
- type World
- func (*World) Descriptor() ([]byte, []int)
- func (this *World) Equal(that interface{}) bool
- func (m *World) GetDim() geometry.Vec3
- func (m *World) GetSectors() map[string]uint64
- func (this *World) GoString() string
- func (m *World) Marshal() (dAtA []byte, err error)
- func (m *World) MarshalTo(dAtA []byte) (int, error)
- func (m *World) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*World) ProtoMessage()
- func (m *World) Reset()
- func (m *World) Size() (n int)
- func (this *World) String() string
- func (m *World) Unmarshal(dAtA []byte) error
- func (m *World) XXX_DiscardUnknown()
- func (m *World) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *World) XXX_Merge(src proto.Message)
- func (m *World) XXX_Size() int
- func (m *World) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthCoordinate = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowCoordinate = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupCoordinate = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthSector = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowSector = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupSector = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthTile = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTile = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTile = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthWorld = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowWorld = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupWorld = fmt.Errorf("proto: unexpected end of group") )
var Terrain_name = map[int32]string{
0: "Sky",
1: "Floor",
2: "Pillar",
3: "Wall",
}
var Terrain_value = map[string]int32{
"Sky": 0,
"Floor": 1,
"Pillar": 2,
"Wall": 3,
}
Functions ¶
func IsCollidable ¶
IsCollidable returns true if terrain t has collision.
Types ¶
type App ¶
type App interface { StoreCoordinate StoreSector StoreWorld StoreTileSet }
Application layer for space domain.
type Coordinate ¶
type Coordinate struct { Position geometry.Vec3 `protobuf:"bytes,1,opt,name=Position,proto3" json:"Position"` Direction geometry.Vec3 `protobuf:"bytes,2,opt,name=Direction,proto3" json:"Direction"` TS uint64 `protobuf:"varint,3,opt,name=TS,proto3" json:"TS,omitempty"` EntityID github_com_elojah_game_02_pkg_ulid.ID `protobuf:"bytes,4,opt,name=EntityID,proto3,customtype=github.com/elojah/game_02/pkg/ulid.ID" json:"EntityID"` }
func NewPopulatedCoordinate ¶
func NewPopulatedCoordinate(r randyCoordinate, easy bool) *Coordinate
func (*Coordinate) Descriptor ¶
func (*Coordinate) Descriptor() ([]byte, []int)
func (*Coordinate) Equal ¶
func (this *Coordinate) Equal(that interface{}) bool
func (*Coordinate) GetDirection ¶
func (m *Coordinate) GetDirection() geometry.Vec3
func (*Coordinate) GetPosition ¶
func (m *Coordinate) GetPosition() geometry.Vec3
func (*Coordinate) GetTS ¶
func (m *Coordinate) GetTS() uint64
func (*Coordinate) GoString ¶
func (this *Coordinate) GoString() string
func (*Coordinate) Marshal ¶
func (m *Coordinate) Marshal() (dAtA []byte, err error)
func (*Coordinate) MarshalToSizedBuffer ¶
func (m *Coordinate) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*Coordinate) ProtoMessage ¶
func (*Coordinate) ProtoMessage()
func (*Coordinate) Reset ¶
func (m *Coordinate) Reset()
func (*Coordinate) Size ¶
func (m *Coordinate) Size() (n int)
func (*Coordinate) String ¶
func (this *Coordinate) String() string
func (*Coordinate) Unmarshal ¶
func (m *Coordinate) Unmarshal(dAtA []byte) error
func (*Coordinate) XXX_DiscardUnknown ¶
func (m *Coordinate) XXX_DiscardUnknown()
func (*Coordinate) XXX_Marshal ¶
func (m *Coordinate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Coordinate) XXX_Merge ¶
func (m *Coordinate) XXX_Merge(src proto.Message)
func (*Coordinate) XXX_Size ¶
func (m *Coordinate) XXX_Size() int
func (*Coordinate) XXX_Unmarshal ¶
func (m *Coordinate) XXX_Unmarshal(b []byte) error
type FilterCoordinate ¶
FilterCoordinate object for entity domain.
type FilterSector ¶
FilterSector object for space domain.
type FilterTileSet ¶
FilterTileSet store filters for tileset.
type FilterWorld ¶
type Orientation ¶
type Orientation uint64
const ( Horizontal Orientation = iota Vertical )
func NewOrientationRand ¶
func NewOrientationRand() Orientation
func (Orientation) Orthogonal ¶
func (o Orientation) Orthogonal() Orientation
type Sector ¶
type Sector struct { ID github_com_elojah_game_02_pkg_ulid.ID `protobuf:"bytes,1,opt,name=ID,proto3,customtype=github.com/elojah/game_02/pkg/ulid.ID" json:"ID"` Dim geometry.Vec3 `protobuf:"bytes,2,opt,name=Dim,proto3" json:"Dim"` Adjacents map[string]geometry.Vec3 `` /* 149-byte string literal not displayed */ TileMap TileMap `protobuf:"bytes,4,opt,name=TileMap,proto3" json:"TileMap"` }
func NewPopulatedSector ¶
func (*Sector) Descriptor ¶
func (*Sector) GetTileMap ¶
func (*Sector) MarshalToSizedBuffer ¶
func (*Sector) ProtoMessage ¶
func (*Sector) ProtoMessage()
func (*Sector) XXX_DiscardUnknown ¶
func (m *Sector) XXX_DiscardUnknown()
func (*Sector) XXX_Marshal ¶
func (*Sector) XXX_Unmarshal ¶
type StoreCoordinate ¶
type StoreCoordinate interface { UpsertCoordinate(context.Context, Coordinate) error FetchManyCoordinate(context.Context, FilterCoordinate) (map[string]Coordinate, error) DeleteCoordinate(context.Context, FilterCoordinate) (Coordinate, error) }
StoreCoordinate object for entity domain.
type StoreSector ¶
type StoreSector interface { UpsertSector(context.Context, Sector) error UpsertManySector(context.Context, []Sector) error FetchSector(context.Context, FilterSector) (Sector, error) FetchManySector(context.Context, chan<- Sector, FilterSector) error DeleteSector(context.Context, FilterSector) error }
Store layer for space domain.
type StoreTileSet ¶
type StoreTileSet interface { UpsertTileSet(context.Context, TileSet) error FetchTileSet(context.Context, FilterTileSet) (TileSet, error) FetchManyTileSet(context.Context, chan<- TileSet, FilterTileSet) error DeleteTileSet(context.Context, FilterTileSet) error }
StoreTileSet layer for tileset domain.
type StoreWorld ¶
type TileMap ¶
type TileMap struct { Set TileSet `protobuf:"bytes,1,opt,name=Set,proto3" json:"Set"` Dim geometry.Vec3 `protobuf:"bytes,2,opt,name=Dim,proto3" json:"Dim"` Map []Terrain `protobuf:"varint,3,rep,packed,name=Map,proto3,enum=space.Terrain" json:"Map,omitempty"` }
func NewPopulatedTileMap ¶
func NewTileMap ¶
NewTileMap creates a new unset tilemap.
func (*TileMap) Descriptor ¶
func (*TileMap) GeneratePaths ¶
GeneratePaths generates random paths between platforms. MUST BE APPLIED on previous generated platforms on SAME AREA.
func (*TileMap) GeneratePlatforms ¶
GeneratePlatforms generate n platforms with variant size and write them into tm. Returns platform array.
func (*TileMap) MarshalToSizedBuffer ¶
func (*TileMap) ProtoMessage ¶
func (*TileMap) ProtoMessage()
func (TileMap) SectorBreaks ¶
SectorBreaks returns sectors from a generated tilemap. dim is maximum sector size splitting.
func (*TileMap) XXX_DiscardUnknown ¶
func (m *TileMap) XXX_DiscardUnknown()
func (*TileMap) XXX_Marshal ¶
func (*TileMap) XXX_Unmarshal ¶
type TileSet ¶
type TileSet struct { // ID MUST be delivered by mapper API as filename.png // e.g: http://url/03432IUHUI.png ID github_com_elojah_game_02_pkg_ulid.ID `protobuf:"bytes,1,opt,name=ID,proto3,customtype=github.com/elojah/game_02/pkg/ulid.ID" json:"-"` // e.g: dungeon,desert,mountain,etc. Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"` // Size of 1 tile in x and y in pixels Size_ uint64 `protobuf:"varint,3,opt,name=Size,proto3" json:"Size,omitempty"` // Number of tile per line X uint64 `protobuf:"varint,4,opt,name=X,proto3" json:"X,omitempty"` // Number of tile per column Y uint64 `protobuf:"varint,5,opt,name=Y,proto3" json:"Y,omitempty"` // Terrains key -> Terrain enum (int32 default pb type) // Terrains value -> absolute index in tileset Terrains map[int32]uint64 `` /* 159-byte string literal not displayed */ }
func NewPopulatedTileSet ¶
func (*TileSet) Descriptor ¶
func (*TileSet) GetTerrains ¶
func (*TileSet) MarshalToSizedBuffer ¶
func (*TileSet) ProtoMessage ¶
func (*TileSet) ProtoMessage()
func (*TileSet) XXX_DiscardUnknown ¶
func (m *TileSet) XXX_DiscardUnknown()
func (*TileSet) XXX_Marshal ¶
func (*TileSet) XXX_Unmarshal ¶
type World ¶
type World struct { ID github_com_elojah_game_02_pkg_ulid.ID `protobuf:"bytes,1,opt,name=ID,proto3,customtype=github.com/elojah/game_02/pkg/ulid.ID" json:"ID"` Dim geometry.Vec3 `protobuf:"bytes,2,opt,name=Dim,proto3" json:"Dim"` Sectors map[string]uint64 `` /* 146-byte string literal not displayed */ }
func NewPopulatedWorld ¶
func (*World) Descriptor ¶
func (*World) GetSectors ¶
func (*World) ProtoMessage ¶
func (*World) ProtoMessage()
func (*World) XXX_DiscardUnknown ¶
func (m *World) XXX_DiscardUnknown()