示例#1
0
文件: arena.go 项目: asciimoo/solary
func Create() *Arena {
	a := &Arena{
		battle_id,
		0,
		make([]*player.Player, 0),
		board.Create(),
	}
	battle_id += 1
	return a
}
示例#2
0
文件: solary.go 项目: asciimoo/solary
func main() {

	address := flag.String("listen", "127.0.0.1:6666", "server listen address")
	players_per_game := flag.Int("players", 2, "number of players in one arena")

	flag.Parse()
	if len(flag.Args()) != 0 {
		switch flag.Args()[0] {
		case "board":
			b := board.Create()
			fmt.Print(b)
		default:
			fmt.Println("Unknown command")
		}
	} else {
		gameLoop(*address, *players_per_game)
	}

}