Implement standard debuggers.
These debug actions are added to all players by default.
This commit is contained in:
		| @@ -5,8 +5,6 @@ import ( | ||||
| 	"fmt" | ||||
|  | ||||
| 	"git.chromaticdragon.app/kistaro/CardSimEngine/cardsim" | ||||
|  | ||||
| 	"github.com/kr/pretty" | ||||
| ) | ||||
|  | ||||
| func main() { | ||||
| @@ -46,7 +44,7 @@ func main() { | ||||
| 			Name:  cardsim.MsgStr("Stats"), | ||||
| 			Intro: cardsim.MsgStr("Hi! These are the smoke test stats."), | ||||
| 		}, | ||||
| 		ruledumper{}, | ||||
| 		cardsim.RuleDumper[*SmokeTestCollection]{}, | ||||
| 	} | ||||
| 	p.Prompt = prompt{} | ||||
| 	p.DebugLevel = 5 | ||||
| @@ -73,13 +71,3 @@ func (prompt) Info(p *cardsim.Player[*SmokeTestCollection]) ([]cardsim.Message, | ||||
| 		cardsim.Msgf("The current Number is %d. It tastes like %s.", p.Stats.Number.Value, p.Stats.Flavor.Value), | ||||
| 	}, nil | ||||
| } | ||||
|  | ||||
| type ruledumper struct{} | ||||
|  | ||||
| func (ruledumper) Title(p *player) cardsim.Message { | ||||
| 	return cardsim.MsgStr("Rule Dumper") | ||||
| } | ||||
|  | ||||
| func (ruledumper) Info(p *player) ([]cardsim.Message, error) { | ||||
| 	return []cardsim.Message{cardsim.Msgf("%# v", pretty.Formatter(p.Rules))}, nil | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user