Files
cheesy-arena-lite/main.go

33 lines
679 B
Go
Raw Normal View History

2014-05-24 00:39:22 -07:00
// Copyright 2014 Team 254. All Rights Reserved.
// Author: pat@patfairbank.com (Patrick Fairbank)
package main
import (
2021-05-16 11:00:29 -07:00
"github.com/Team254/cheesy-arena-lite/field"
"github.com/Team254/cheesy-arena-lite/web"
2014-05-24 00:39:22 -07:00
"log"
2014-05-25 17:21:42 -07:00
"math/rand"
"time"
2014-05-24 00:39:22 -07:00
)
2014-06-07 02:02:12 -07:00
const eventDbPath = "./event.db"
const httpPort = 8080
// Main entry point for the application.
2014-05-24 00:39:22 -07:00
func main() {
2014-05-25 17:21:42 -07:00
rand.Seed(time.Now().UnixNano())
2014-06-07 02:02:12 -07:00
arena, err := field.NewArena(eventDbPath)
2014-05-24 00:39:22 -07:00
if err != nil {
log.Fatalln("Error during startup: ", err)
2014-05-24 00:39:22 -07:00
}
// Start the web server in a separate goroutine.
web := web.NewWeb(arena)
go web.ServeWebInterface(httpPort)
// Run the arena state machine in the main thread.
arena.Run()
2014-05-24 00:39:22 -07:00
}