package engine

import (
	"zworld/engine/rule"
)

type FWorldRuleWrap struct {
	TimeRule  *rule.FTimeRule
	ActorRule *rule.FActorRule
}
type FWorld struct {
	Name     string
	RuleList []IRule
	RuleWrap *FWorldRuleWrap
}

func (w *FWorld) Tick() {
	delta := w.RuleWrap.TimeRule.GetInterval()
	if delta == 0 {
		w.RuleWrap.TimeRule.Tick(w, delta)
		return
	}
	for _, rule := range w.RuleList {
		rule.Tick(w, delta)
	}
}
