tome_game

package module
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: GPL-3.0 Imports: 6 Imported by: 1

README

Tomecraft Engine

This repo contains the core rules engine for Tomecraft.

This combined with tome_lib should let you write up the game engine for either local use or for use in a server.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(g *Game)

func NewBoard

func NewBoard() *Board

func NewCard

func NewCard(v, o, p int, id uuid.UUID) *Card

func NewDeck

func NewDeck(owner int) *Deck

func NewPlayer

func NewPlayer(name string, id int) *Player

func NewView

func NewView(id int, g *Game) *GameView

func OracleAttack

func OracleAttack(c *Card, g *Game)

func OracleCast

func OracleCast(c *Card, g *Game) bool

func OracleEffect

func OracleEffect(c *Card, g *Game)

func OracleEndstep

func OracleEndstep(c *Card, g *Game)

func OracleEnters

func OracleEnters(c *Card, g *Game)

func OracleLeaves

func OracleLeaves(c *Card, g *Game)

func OracleMove

func OracleMove(c *Card, src, dest int, g *Game)

func OraclePower

func OraclePower(c CardType, g *Game) int

func OracleSpell

func OracleSpell(c CardType, g *Game) bool

func OracleTick

func OracleTick(c *Card, g *Game)

func OracleUpkeep

func OracleUpkeep(c *Card, g *Game)

Types

type Game

type Game struct {
	GameBoard      *Board
	SentinalPlayer *Player
	ScourgePlayer  *Player
	SentinalDeck   *Deck
	ScourgeDeck    *Deck
	SentinalGrave  *Deck
	ScourgeGrave   *Deck
	CurrentTurn    int
	CardBuffer     *Deck
	CanDraw        bool
	HasDrawn       bool
	Status         GameStatus
}

func NewGame

func NewGame() *Game

func (*Game) Bury added in v0.1.5

func (g *Game) Bury(c *Card)

func (*Game) GetBoard added in v0.1.2

func (g *Game) GetBoard(id int) []*Card

func (*Game) GetDeck added in v0.1.2

func (g *Game) GetDeck(id int) *Deck

func (*Game) GetGrave added in v0.1.5

func (g *Game) GetGrave(id int) *Deck

func (*Game) GetOpponent added in v0.1.2

func (g *Game) GetOpponent(id int) *Player

func (*Game) GetOpponentDeck added in v0.1.2

func (g *Game) GetOpponentDeck(id int) *Deck

func (*Game) GetPlayer added in v0.1.2

func (g *Game) GetPlayer(id int) *Player

func (*Game) Parse

func (g *Game) Parse(cmd *Command) *CommandResult

func (*Game) PlayerAct

func (g *Game) PlayerAct(id int, cmd string) *Deck

func (*Game) PlayerStateAct

func (g *Game) PlayerStateAct(id int, cmd string) *GameView

func (*Game) StateChanges

func (g *Game) StateChanges()

func (*Game) String

func (g *Game) String() string

Jump to

Keyboard shortcuts

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