mirror of
https://github.com/bloeys/nmage.git
synced 2025-12-29 05:18:21 +00:00
Starting entities, components, and levels
This commit is contained in:
20
level/level.go
Executable file
20
level/level.go
Executable file
@ -0,0 +1,20 @@
|
||||
package level
|
||||
|
||||
import (
|
||||
"github.com/bloeys/nmage/assert"
|
||||
"github.com/bloeys/nmage/entity"
|
||||
)
|
||||
|
||||
type Level struct {
|
||||
*entity.Registry
|
||||
Name string
|
||||
}
|
||||
|
||||
func NewLevel(name string, maxEntities uint32) *Level {
|
||||
|
||||
assert.T(name != "", "Level name can not be empty")
|
||||
return &Level{
|
||||
Name: name,
|
||||
Registry: entity.NewRegistry(maxEntities),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user