gonster

package
v0.0.0-...-c817f10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2022 License: Unlicense Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GONSTER1_WIN = "GONSTER1_WIN"
	GONSTER2_WIN = "GONSTER2_WIN"
	DRAW         = "DRAW"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Gonster

type Gonster struct {
	Health int
	Head   int
	Torso  int
	Arm    int
	Leg    int
}

type GonsterGenerator

type GonsterGenerator interface {
	Generate(seed int) (Gonster, []byte)
}

type ProtoGonsterGen

type ProtoGonsterGen struct{}

func (ProtoGonsterGen) Generate

func (pgg ProtoGonsterGen) Generate(seed int) (Gonster, []byte)

type ProtoSimulator

type ProtoSimulator struct {
	ActionLog    [][]SimulatorActionLog
	BattleResult string
}

func (*ProtoSimulator) Start

func (sim *ProtoSimulator) Start(gonster1 Gonster, gonster2 Gonster, rounds int) (ProtoSimulator, error)

type Simulator

type Simulator interface {
	Start(gonster1 Gonster, gonster2 Gonster, rounds int) (any, error)
}

type SimulatorActionLog

type SimulatorActionLog struct {
	RemainingHealth   int
	DiceRoll          int
	AttackProbability int
	IsAttackSuccess   bool
	DamagePrevented   int
	TotalDamage       int
}

func SimulateBattle

func SimulateBattle(attacker Gonster, defender Gonster, seed int64) *SimulatorActionLog

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL