Compare commits
17 Commits
Author | SHA1 | Date |
---|---|---|
Nick Dumas | ac675e5c43 | 1 year ago |
Nick Dumas | 9dc627028c | 1 year ago |
Nick Dumas | c7c774041b | 1 year ago |
Nick Dumas | 884137a986 | 1 year ago |
Nick Dumas | c0e4adb98f | 1 year ago |
Nick Dumas | a35a935bab | 1 year ago |
Nick Dumas | 191725f700 | 1 year ago |
Nick Dumas | be601acec6 | 1 year ago |
Nick Dumas | 68824221c1 | 1 year ago |
Nick Dumas | 605d728f83 | 1 year ago |
Nick Dumas | 2447914517 | 1 year ago |
Nick Dumas | f3898fe694 | 1 year ago |
Nick Dumas | e3e46ae2bd | 1 year ago |
Nick Dumas | 7766253319 | 1 year ago |
Nick Dumas | 9eadcedb0b | 1 year ago |
Nick Dumas | 07e6cab5cd | 1 year ago |
Nick Dumas | 484fef459f | 1 year ago |
@ -0,0 +1,10 @@
|
||||
org.label-schema.name="gomud echo"
|
||||
org.label-schema.description="simple echo server for testing gomud functionality"
|
||||
org.label-schema.vcs-ref=$VCS_REF // this is a git commit, parameterize this too
|
||||
org.label-schema.vcs-url=code.ndumas.com/ndumas/gomud
|
||||
org.label-schema.license="MIT License"
|
||||
org.label-schema.schema-version="" // TODO: parameterize this
|
||||
name="gomud-echo"
|
||||
vendor="ndumas"
|
||||
description="simple echo server for testing gomud functionality"
|
||||
summary="Deploy a gomud echo server"
|
@ -0,0 +1,18 @@
|
||||
load("@rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "ecs_lib",
|
||||
srcs = ["main.go"],
|
||||
importpath = "code.ndumas.com/ndumas/gomud/cmd/ecs",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"//engine",
|
||||
"@com_github_engoengine_ecs//:ecs",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "ecs",
|
||||
embed = [":ecs_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
@ -0,0 +1,33 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
// "fmt"
|
||||
|
||||
"github.com/EngoEngine/ecs"
|
||||
|
||||
"code.ndumas.com/ndumas/gomud/engine"
|
||||
)
|
||||
|
||||
func main() {
|
||||
w := ecs.World{}
|
||||
trs := engine.TELNETRenderSystem{}
|
||||
|
||||
w.AddSystem(trs)
|
||||
|
||||
player1 := engine.DemoEntity{
|
||||
ecs.NewBasic(),
|
||||
&engine.RenderComponent{
|
||||
Color: true,
|
||||
},
|
||||
}
|
||||
|
||||
w.AddEntity(&player1)
|
||||
// addbyinterface isn't working right, why
|
||||
|
||||
w.Update(.25)
|
||||
w.Update(.25)
|
||||
w.Update(.25)
|
||||
w.Update(.25)
|
||||
w.Update(.25)
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
load("@rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "ecs",
|
||||
srcs = ["world.go"],
|
||||
importpath = "code.ndumas.com/ndumas/gomud/ecs",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = ["@com_github_engoengine_engo//:engo"],
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "engine",
|
||||
srcs = [
|
||||
"components.go",
|
||||
"telnetrenderer.go",
|
||||
"world.go",
|
||||
],
|
||||
importpath = "code.ndumas.com/ndumas/gomud/engine",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = ["@com_github_engoengine_ecs//:ecs"],
|
||||
)
|
@ -0,0 +1,10 @@
|
||||
package engine
|
||||
|
||||
type LocationComponent struct {
|
||||
RoomID int
|
||||
}
|
||||
|
||||
type PlayerComponent struct {
|
||||
ID int
|
||||
Username string
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package engine
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
|
||||
"github.com/EngoEngine/ecs"
|
||||
)
|
||||
|
||||
type RenderComponent struct {
|
||||
Color bool
|
||||
}
|
||||
|
||||
func (rc *RenderComponent) GetRenderComponent() *RenderComponent {
|
||||
return rc
|
||||
}
|
||||
|
||||
type RenderComponentInterface interface {
|
||||
ecs.BasicFace
|
||||
GetRenderComponent() *RenderComponent
|
||||
}
|
||||
|
||||
type DemoEntity struct {
|
||||
ecs.BasicEntity
|
||||
*RenderComponent
|
||||
}
|
||||
|
||||
type TELNETRenderSystem struct {
|
||||
entities map[uint64]RenderComponentInterface
|
||||
conns map[uint64]net.Conn
|
||||
}
|
||||
|
||||
func Priority() int { return 100 }
|
||||
|
||||
func New(w *ecs.World) {
|
||||
|
||||
}
|
||||
|
||||
func (trs *TELNETRenderSystem) AddByInterface(o ecs.Identifier) {
|
||||
fmt.Println("calling AddByInterface")
|
||||
v := o.(RenderComponentInterface)
|
||||
trs.entities[o.ID()] = v
|
||||
}
|
||||
|
||||
func (trs TELNETRenderSystem) Update(dt float32) {
|
||||
for _, e := range trs.entities {
|
||||
fmt.Println("bing bong", e)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (trs TELNETRenderSystem) Remove(e ecs.BasicEntity) {
|
||||
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
package engine
|
||||
|
||||
import ()
|
@ -0,0 +1,9 @@
|
||||
load("@rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "logger",
|
||||
srcs = ["wrappedslogger.go"],
|
||||
importpath = "code.ndumas.com/ndumas/gomud/logger",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = ["@com_github_threedotslabs_watermill//:watermill"],
|
||||
)
|
@ -0,0 +1,6 @@
|
||||
#! /bin/bash
|
||||
|
||||
tag=$(git describe --tags --dirty=-dev)
|
||||
commit=$(git rev-parse HEAD | head -c8)
|
||||
echo "STABLE_GIT_VERSION $tag"
|
||||
echo "STABLE_GIT_COMMIT $commit"
|
@ -0,0 +1,6 @@
|
||||
package gomud
|
||||
|
||||
const (
|
||||
VERSION = ""
|
||||
BUILD = ""
|
||||
)
|
Loading…
Reference in New Issue