diff --git a/action/action.go b/action/action.go index 673d954..0734279 100644 --- a/action/action.go +++ b/action/action.go @@ -1,7 +1,7 @@ package action import ( - "github.com/xescugc/ltw/utils" + "github.com/xescugc/maze-wars/utils" "nhooyr.io/websocket" ) diff --git a/client/action.go b/client/action.go index 51680b3..6a7815a 100644 --- a/client/action.go +++ b/client/action.go @@ -2,7 +2,7 @@ package client import ( "github.com/xescugc/go-flux" - "github.com/xescugc/ltw/action" + "github.com/xescugc/maze-wars/action" ) // ActionDispatcher is in charge of dispatching actions to the diff --git a/client/camera.go b/client/camera.go index 7884064..2584cbe 100644 --- a/client/camera.go +++ b/client/camera.go @@ -3,9 +3,9 @@ package client import ( "github.com/hajimehoshi/ebiten/v2" "github.com/xescugc/go-flux" - "github.com/xescugc/ltw/action" - "github.com/xescugc/ltw/store" - "github.com/xescugc/ltw/utils" + "github.com/xescugc/maze-wars/action" + "github.com/xescugc/maze-wars/store" + "github.com/xescugc/maze-wars/utils" ) // CameraStore is in charge of what it's seen @@ -54,7 +54,7 @@ func NewCameraStore(d *flux.Dispatcher, s *store.Store, w, h int) *CameraStore { } func (cs *CameraStore) Update() error { - // TODO: https://github.com/xescugc/ltw/issues/4 + // TODO: https://github.com/xescugc/maze-wars/issues/4 //s := cs.GetState().(CameraState) //if _, wy := ebiten.Wheel(); wy != 0 { //fmt.Println(s.Zoom) diff --git a/client/game.go b/client/game.go index 2c68257..ceec268 100644 --- a/client/game.go +++ b/client/game.go @@ -4,7 +4,7 @@ import ( "image" "github.com/hajimehoshi/ebiten/v2" - "github.com/xescugc/ltw/store" + "github.com/xescugc/maze-wars/store" ) // Game is the main struct that is the initializer diff --git a/client/hud.go b/client/hud.go index c4ce793..9dad0c4 100644 --- a/client/hud.go +++ b/client/hud.go @@ -11,13 +11,13 @@ import ( "github.com/hajimehoshi/ebiten/v2" "github.com/hajimehoshi/ebiten/v2/text" "github.com/xescugc/go-flux" - "github.com/xescugc/ltw/action" - "github.com/xescugc/ltw/assets" - "github.com/xescugc/ltw/inputer" - "github.com/xescugc/ltw/store" - "github.com/xescugc/ltw/tower" - "github.com/xescugc/ltw/unit" - "github.com/xescugc/ltw/utils" + "github.com/xescugc/maze-wars/action" + "github.com/xescugc/maze-wars/assets" + "github.com/xescugc/maze-wars/inputer" + "github.com/xescugc/maze-wars/store" + "github.com/xescugc/maze-wars/tower" + "github.com/xescugc/maze-wars/unit" + "github.com/xescugc/maze-wars/utils" ) // HUDStore is in charge of keeping track of all the elements diff --git a/client/lobby.go b/client/lobby.go index 72be56b..463fc79 100644 --- a/client/lobby.go +++ b/client/lobby.go @@ -9,11 +9,11 @@ import ( "github.com/hajimehoshi/ebiten/v2" "github.com/hajimehoshi/ebiten/v2/text" "github.com/xescugc/go-flux" - "github.com/xescugc/ltw/action" - "github.com/xescugc/ltw/assets" - "github.com/xescugc/ltw/inputer" - "github.com/xescugc/ltw/store" - "github.com/xescugc/ltw/utils" + "github.com/xescugc/maze-wars/action" + "github.com/xescugc/maze-wars/assets" + "github.com/xescugc/maze-wars/inputer" + "github.com/xescugc/maze-wars/store" + "github.com/xescugc/maze-wars/utils" ) type LobbyStore struct { diff --git a/client/logger.go b/client/logger.go index 445edc2..4e672b9 100644 --- a/client/logger.go +++ b/client/logger.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/xescugc/go-flux" - "github.com/xescugc/ltw/action" + "github.com/xescugc/maze-wars/action" ) // LoggerStore is a logger store in charge of logging all the actions diff --git a/client/new.go b/client/new.go index eb24100..cbfa902 100644 --- a/client/new.go +++ b/client/new.go @@ -9,8 +9,8 @@ import ( "time" "github.com/hajimehoshi/ebiten/v2" - "github.com/xescugc/ltw/action" - "github.com/xescugc/ltw/assets" + "github.com/xescugc/maze-wars/action" + "github.com/xescugc/maze-wars/assets" "golang.org/x/image/font" "golang.org/x/image/font/opentype" "nhooyr.io/websocket" @@ -58,7 +58,7 @@ func init() { } func New(ctx context.Context, ad *ActionDispatcher, rs *RouterStore, opt Options) error { - ebiten.SetWindowTitle("LTW") + ebiten.SetWindowTitle("Maze Wars") ebiten.SetWindowSize(opt.ScreenW*2, opt.ScreenH*2) ebiten.SetWindowResizingMode(ebiten.WindowResizingModeEnabled) diff --git a/client/router.go b/client/router.go index be7064f..df8c834 100644 --- a/client/router.go +++ b/client/router.go @@ -3,7 +3,7 @@ package client import ( "github.com/hajimehoshi/ebiten/v2" "github.com/xescugc/go-flux" - "github.com/xescugc/ltw/action" + "github.com/xescugc/maze-wars/action" ) const ( diff --git a/client/towers.go b/client/towers.go index 3730db4..5fb363b 100644 --- a/client/towers.go +++ b/client/towers.go @@ -5,9 +5,9 @@ import ( "image" "github.com/hajimehoshi/ebiten/v2" - "github.com/xescugc/ltw/assets" - "github.com/xescugc/ltw/store" - "github.com/xescugc/ltw/tower" + "github.com/xescugc/maze-wars/assets" + "github.com/xescugc/maze-wars/store" + "github.com/xescugc/maze-wars/tower" ) type Towers struct { diff --git a/client/units.go b/client/units.go index fb9f178..39b4a0a 100644 --- a/client/units.go +++ b/client/units.go @@ -7,10 +7,10 @@ import ( "image/color" "github.com/hajimehoshi/ebiten/v2" - "github.com/xescugc/ltw/assets" - "github.com/xescugc/ltw/store" - "github.com/xescugc/ltw/unit" - "github.com/xescugc/ltw/utils" + "github.com/xescugc/maze-wars/assets" + "github.com/xescugc/maze-wars/store" + "github.com/xescugc/maze-wars/unit" + "github.com/xescugc/maze-wars/utils" ) type Units struct { diff --git a/client/wasm/main.go b/client/wasm/main.go index addc1fc..ecf76dd 100644 --- a/client/wasm/main.go +++ b/client/wasm/main.go @@ -9,9 +9,9 @@ import ( "syscall/js" "github.com/xescugc/go-flux" - "github.com/xescugc/ltw/client" - "github.com/xescugc/ltw/inputer" - "github.com/xescugc/ltw/store" + "github.com/xescugc/maze-wars/client" + "github.com/xescugc/maze-wars/inputer" + "github.com/xescugc/maze-wars/store" ) func main() { diff --git a/cmd/client.go b/cmd/client.go deleted file mode 100644 index d7cbd70..0000000 --- a/cmd/client.go +++ /dev/null @@ -1,81 +0,0 @@ -package cmd - -import ( - "context" - "fmt" - - "github.com/spf13/cobra" - "github.com/xescugc/go-flux" - "github.com/xescugc/ltw/client" - "github.com/xescugc/ltw/inputer" - "github.com/xescugc/ltw/store" -) - -var ( - room string - name string - hostURL string - screenW int - screenH int - - clientCmd = &cobra.Command{ - Use: "client", - RunE: func(cmd *cobra.Command, args []string) error { - var err error - - d := flux.NewDispatcher() - ad := client.NewActionDispatcher(d) - - s := store.NewStore(d) - - g := &client.Game{ - Store: s, - } - - i := inputer.NewEbiten() - - // TODO: Change this to pass the specific store needed instead of all the game object - cs := client.NewCameraStore(d, s, screenW, screenH) - g.Camera = cs - g.Units, err = client.NewUnits(g) - if err != nil { - return fmt.Errorf("failed to initialize Units: %w", err) - } - - g.Towers, err = client.NewTowers(g) - if err != nil { - return fmt.Errorf("failed to initialize Towers: %w", err) - } - - g.HUD, err = client.NewHUDStore(d, i, g) - if err != nil { - return fmt.Errorf("failed to initialize HUDStore: %w", err) - } - - l, err := client.NewLobbyStore(d, i, s, cs) - if err != nil { - return fmt.Errorf("failed to initialize LobbyStore: %w", err) - } - rs := client.NewRouterStore(d, g, l) - ctx := context.Background() - - err = client.New(ctx, ad, rs, client.Options{ - HostURL: hostURL, - Room: room, - Name: name, - ScreenW: screenW, - ScreenH: screenH, - }) - - return err - }, - } -) - -func init() { - clientCmd.Flags().StringVar(&hostURL, "port", "localhost:5555", "The URL of the server") - clientCmd.Flags().StringVar(&room, "room", "room", "The room name to join") - clientCmd.Flags().StringVar(&name, "name", "john doe", "The name of the client") - clientCmd.Flags().IntVar(&screenW, "screenw", 288, "The default width of the screen when not full screen") - clientCmd.Flags().IntVar(&screenH, "screenh", 240, "The default height of the screen when not full screen") -} diff --git a/cmd/client/main.go b/cmd/client/main.go index 76ab6b0..7e7f948 100644 --- a/cmd/client/main.go +++ b/cmd/client/main.go @@ -7,9 +7,9 @@ import ( "github.com/spf13/cobra" "github.com/xescugc/go-flux" - "github.com/xescugc/ltw/client" - "github.com/xescugc/ltw/inputer" - "github.com/xescugc/ltw/store" + "github.com/xescugc/maze-wars/client" + "github.com/xescugc/maze-wars/inputer" + "github.com/xescugc/maze-wars/store" ) var ( diff --git a/cmd/root.go b/cmd/root.go deleted file mode 100644 index d5aa8fb..0000000 --- a/cmd/root.go +++ /dev/null @@ -1,23 +0,0 @@ -package cmd - -import ( - "github.com/spf13/cobra" -) - -var ( - rootCmd = &cobra.Command{ - Use: "ltw", - } -) - -// Execute executes the root command. -func Execute() error { - return rootCmd.Execute() -} - -func init() { - rootCmd.AddCommand( - serverCmd, - clientCmd, - ) -} diff --git a/cmd/server.go b/cmd/server.go deleted file mode 100644 index e876db2..0000000 --- a/cmd/server.go +++ /dev/null @@ -1,35 +0,0 @@ -package cmd - -import ( - "fmt" - - "github.com/spf13/cobra" - "github.com/xescugc/go-flux" - "github.com/xescugc/ltw/server" -) - -var ( - serverPort string - - serverCmd = &cobra.Command{ - Use: "server", - RunE: func(cmd *cobra.Command, args []string) error { - d := flux.NewDispatcher() - ad := server.NewActionDispatcher(d) - rooms := server.NewRoomsStore(d) - - err := server.New(ad, rooms, server.Options{ - Port: serverPort, - }) - if err != nil { - return fmt.Errorf("server error: %w", err) - } - - return nil - }, - } -) - -func init() { - serverCmd.Flags().StringVar(&serverPort, "port", ":5555", "The port in which the sever is open") -} diff --git a/cmd/server/main.go b/cmd/server/main.go index f8d205f..0c7b6c7 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -8,7 +8,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/xescugc/go-flux" - "github.com/xescugc/ltw/server" + "github.com/xescugc/maze-wars/server" ) var ( diff --git a/go.mod b/go.mod index a7ac5a0..79c04f5 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/xescugc/ltw +module github.com/xescugc/maze-wars go 1.21 diff --git a/inputer/inputer.go b/inputer/inputer.go index a35cdab..095980d 100644 --- a/inputer/inputer.go +++ b/inputer/inputer.go @@ -5,7 +5,7 @@ import ( "github.com/hajimehoshi/ebiten/v2/inpututil" ) -//go:generate mockgen -destination=../mock/inputer.go -package mock github.com/xescugc/ltw/inputer Inputer +//go:generate mockgen -destination=../mock/inputer.go -package mock github.com/xescugc/maze-wars/inputer Inputer type Inputer interface { CursorPosition() (int, int) diff --git a/integration/main_test.go b/integration/main_test.go index 53ea7cb..dc6a617 100644 --- a/integration/main_test.go +++ b/integration/main_test.go @@ -13,11 +13,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/xescugc/go-flux" - "github.com/xescugc/ltw/action" - "github.com/xescugc/ltw/client" - "github.com/xescugc/ltw/mock" - "github.com/xescugc/ltw/server" - "github.com/xescugc/ltw/store" + "github.com/xescugc/maze-wars/action" + "github.com/xescugc/maze-wars/client" + "github.com/xescugc/maze-wars/mock" + "github.com/xescugc/maze-wars/server" + "github.com/xescugc/maze-wars/store" ) //"github.com/stretchr/testify/assert" diff --git a/mock/inputer.go b/mock/inputer.go index cc4b5ff..00c3212 100644 --- a/mock/inputer.go +++ b/mock/inputer.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/xescugc/ltw/inputer (interfaces: Inputer) +// Source: github.com/xescugc/maze-wars/inputer (interfaces: Inputer) // Package mock is a generated GoMock package. package mock diff --git a/server/action.go b/server/action.go index 94c07ee..7318102 100644 --- a/server/action.go +++ b/server/action.go @@ -5,8 +5,8 @@ import ( "log" "github.com/xescugc/go-flux" - "github.com/xescugc/ltw/action" - "github.com/xescugc/ltw/store" + "github.com/xescugc/maze-wars/action" + "github.com/xescugc/maze-wars/store" "nhooyr.io/websocket" "nhooyr.io/websocket/wsjson" ) diff --git a/server/assets/wasm/maze-wars.wasm b/server/assets/wasm/maze-wars.wasm index 45d73cd..e6a81c0 100755 Binary files a/server/assets/wasm/maze-wars.wasm and b/server/assets/wasm/maze-wars.wasm differ diff --git a/server/game.go b/server/game.go index 342da51..c46183c 100644 --- a/server/game.go +++ b/server/game.go @@ -2,7 +2,7 @@ package server import ( "github.com/xescugc/go-flux" - "github.com/xescugc/ltw/store" + "github.com/xescugc/maze-wars/store" ) type Game struct { diff --git a/server/new.go b/server/new.go index b94c99c..05dce18 100644 --- a/server/new.go +++ b/server/new.go @@ -14,9 +14,9 @@ import ( "nhooyr.io/websocket" "nhooyr.io/websocket/wsjson" - "github.com/xescugc/ltw/action" - "github.com/xescugc/ltw/server/assets" - "github.com/xescugc/ltw/server/templates" + "github.com/xescugc/maze-wars/action" + "github.com/xescugc/maze-wars/server/assets" + "github.com/xescugc/maze-wars/server/templates" ) var ( diff --git a/server/room.go b/server/room.go index d897ce4..b270ca1 100644 --- a/server/room.go +++ b/server/room.go @@ -4,7 +4,7 @@ import ( "sync" "github.com/xescugc/go-flux" - "github.com/xescugc/ltw/action" + "github.com/xescugc/maze-wars/action" "nhooyr.io/websocket" ) diff --git a/store/helper_test.go b/store/helper_test.go index 114dbc4..f74d122 100644 --- a/store/helper_test.go +++ b/store/helper_test.go @@ -5,10 +5,10 @@ import ( "github.com/gofrs/uuid" "github.com/xescugc/go-flux" - "github.com/xescugc/ltw/action" - "github.com/xescugc/ltw/store" - "github.com/xescugc/ltw/tower" - "github.com/xescugc/ltw/unit" + "github.com/xescugc/maze-wars/action" + "github.com/xescugc/maze-wars/store" + "github.com/xescugc/maze-wars/tower" + "github.com/xescugc/maze-wars/unit" "nhooyr.io/websocket" ) diff --git a/store/map.go b/store/map.go index 3e4a653..a9fe7b0 100644 --- a/store/map.go +++ b/store/map.go @@ -7,9 +7,9 @@ import ( "math/rand" "github.com/xescugc/go-flux" - "github.com/xescugc/ltw/action" - "github.com/xescugc/ltw/assets" - "github.com/xescugc/ltw/utils" + "github.com/xescugc/maze-wars/action" + "github.com/xescugc/maze-wars/assets" + "github.com/xescugc/maze-wars/utils" ) var ( diff --git a/store/map_test.go b/store/map_test.go index 75f9590..c557f08 100644 --- a/store/map_test.go +++ b/store/map_test.go @@ -8,9 +8,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/xescugc/go-flux" - "github.com/xescugc/ltw/action" - "github.com/xescugc/ltw/assets" - "github.com/xescugc/ltw/store" + "github.com/xescugc/maze-wars/action" + "github.com/xescugc/maze-wars/assets" + "github.com/xescugc/maze-wars/store" ) func TestNewMap(t *testing.T) { diff --git a/store/players.go b/store/players.go index 682092c..fee9f38 100644 --- a/store/players.go +++ b/store/players.go @@ -4,9 +4,9 @@ import ( "sync" "github.com/xescugc/go-flux" - "github.com/xescugc/ltw/action" - "github.com/xescugc/ltw/tower" - "github.com/xescugc/ltw/unit" + "github.com/xescugc/maze-wars/action" + "github.com/xescugc/maze-wars/tower" + "github.com/xescugc/maze-wars/unit" ) const ( diff --git a/store/players_test.go b/store/players_test.go index b7fd6f2..51a2db4 100644 --- a/store/players_test.go +++ b/store/players_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/xescugc/go-flux" - "github.com/xescugc/ltw/action" - "github.com/xescugc/ltw/store" + "github.com/xescugc/maze-wars/action" + "github.com/xescugc/maze-wars/store" "nhooyr.io/websocket" ) diff --git a/store/reduce_test.go b/store/reduce_test.go index 9808945..c10ac56 100644 --- a/store/reduce_test.go +++ b/store/reduce_test.go @@ -5,11 +5,11 @@ import ( "github.com/gofrs/uuid" "github.com/stretchr/testify/assert" - "github.com/xescugc/ltw/action" - "github.com/xescugc/ltw/store" - "github.com/xescugc/ltw/tower" - "github.com/xescugc/ltw/unit" - "github.com/xescugc/ltw/utils" + "github.com/xescugc/maze-wars/action" + "github.com/xescugc/maze-wars/store" + "github.com/xescugc/maze-wars/tower" + "github.com/xescugc/maze-wars/unit" + "github.com/xescugc/maze-wars/utils" "nhooyr.io/websocket" ) diff --git a/store/store.go b/store/store.go index 3e7afca..27e03ba 100644 --- a/store/store.go +++ b/store/store.go @@ -2,7 +2,7 @@ package store import ( "github.com/xescugc/go-flux" - "github.com/xescugc/ltw/action" + "github.com/xescugc/maze-wars/action" ) type Store struct { diff --git a/store/store_test.go b/store/store_test.go index 01053af..0c07210 100644 --- a/store/store_test.go +++ b/store/store_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/xescugc/go-flux" - "github.com/xescugc/ltw/store" + "github.com/xescugc/maze-wars/store" ) func TestNewStore(t *testing.T) { diff --git a/store/towers.go b/store/towers.go index 0c470c6..d22d4e0 100644 --- a/store/towers.go +++ b/store/towers.go @@ -6,9 +6,9 @@ import ( "github.com/gofrs/uuid" "github.com/xescugc/go-flux" - "github.com/xescugc/ltw/action" - "github.com/xescugc/ltw/tower" - "github.com/xescugc/ltw/utils" + "github.com/xescugc/maze-wars/action" + "github.com/xescugc/maze-wars/tower" + "github.com/xescugc/maze-wars/utils" ) type Towers struct { diff --git a/store/towers_test.go b/store/towers_test.go index 745cf8a..3cc66ab 100644 --- a/store/towers_test.go +++ b/store/towers_test.go @@ -5,10 +5,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/xescugc/go-flux" - "github.com/xescugc/ltw/action" - "github.com/xescugc/ltw/store" - "github.com/xescugc/ltw/tower" - "github.com/xescugc/ltw/utils" + "github.com/xescugc/maze-wars/action" + "github.com/xescugc/maze-wars/store" + "github.com/xescugc/maze-wars/tower" + "github.com/xescugc/maze-wars/utils" ) func TestNewTowers(t *testing.T) { diff --git a/store/unit_astar.go b/store/unit_astar.go index dba9c18..74a0820 100644 --- a/store/unit_astar.go +++ b/store/unit_astar.go @@ -4,7 +4,7 @@ import ( "container/heap" "fmt" - "github.com/xescugc/ltw/utils" + "github.com/xescugc/maze-wars/utils" ) // stepMap is a collection of steps for quick reference diff --git a/store/units.go b/store/units.go index e9335b8..ed45196 100644 --- a/store/units.go +++ b/store/units.go @@ -7,10 +7,10 @@ import ( "github.com/gofrs/uuid" "github.com/xescugc/go-flux" - "github.com/xescugc/ltw/action" - "github.com/xescugc/ltw/tower" - "github.com/xescugc/ltw/unit" - "github.com/xescugc/ltw/utils" + "github.com/xescugc/maze-wars/action" + "github.com/xescugc/maze-wars/tower" + "github.com/xescugc/maze-wars/unit" + "github.com/xescugc/maze-wars/utils" ) type Units struct { diff --git a/store/units_test.go b/store/units_test.go index e8b4b10..78aa0bf 100644 --- a/store/units_test.go +++ b/store/units_test.go @@ -5,10 +5,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/xescugc/go-flux" - "github.com/xescugc/ltw/action" - "github.com/xescugc/ltw/store" - "github.com/xescugc/ltw/unit" - "github.com/xescugc/ltw/utils" + "github.com/xescugc/maze-wars/action" + "github.com/xescugc/maze-wars/store" + "github.com/xescugc/maze-wars/unit" + "github.com/xescugc/maze-wars/utils" ) func TestNewUnits(t *testing.T) { diff --git a/tower/tower.go b/tower/tower.go index be8de24..fd16d4f 100644 --- a/tower/tower.go +++ b/tower/tower.go @@ -6,7 +6,7 @@ import ( "image" "log" - "github.com/xescugc/ltw/assets" + "github.com/xescugc/maze-wars/assets" ) type Tower struct { diff --git a/unit/unit.go b/unit/unit.go index ba9ab0f..2c1448d 100644 --- a/unit/unit.go +++ b/unit/unit.go @@ -6,7 +6,7 @@ import ( "image" "log" - "github.com/xescugc/ltw/assets" + "github.com/xescugc/maze-wars/assets" ) type Unit struct {