state

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FrameDefinition

type FrameDefinition struct {
	// Pattern code lines for this frame
	Lines []string

	// Optional custom frame name (if not using default naming)
	CustomName string
}

FrameDefinition defines a single animation frame

type FrameValidationError

type FrameValidationError struct {
	FrameIndex int
	LineIndex  int
	Message    string
}

FrameValidationError represents an error in frame validation

func (*FrameValidationError) Error

func (e *FrameValidationError) Error() string

type FrameValidator

type FrameValidator struct {
	// contains filtered or unexported fields
}

FrameValidator validates frame definitions

func NewFrameValidator

func NewFrameValidator() *FrameValidator

NewFrameValidator creates a new frame validator

func (*FrameValidator) ValidateDimensions

func (fv *FrameValidator) ValidateDimensions(frames []FrameDefinition, expectedWidth, expectedHeight int) error

ValidateDimensions validates frame dimensions match expected width/height

func (*FrameValidator) ValidateFrame

func (fv *FrameValidator) ValidateFrame(frame *FrameDefinition, frameIndex int) error

ValidateFrame validates a single frame definition

func (*FrameValidator) ValidateFramesConsistency

func (fv *FrameValidator) ValidateFramesConsistency(frames []FrameDefinition) error

ValidateFramesConsistency checks that all frames in a set have consistent dimensions

func (*FrameValidator) ValidateStateConfig

func (fv *FrameValidator) ValidateStateConfig(config *StateConfig) error

ValidateStateConfig validates the entire state configuration

type StateAddResult

type StateAddResult struct {
	// Characters that were successfully updated
	UpdatedCharacters []string

	// Characters that failed to update
	FailedCharacters map[string]error

	// Total frames added
	FramesAdded int

	// Documentation files updated
	DocsUpdated []string

	// Whether any height changes were made
	HeightChanged bool
}

StateAddResult contains the results of adding a state

type StateConfig

type StateConfig struct {
	// Name of the state (e.g., "arise", "sleeping")
	Name string

	// Description of what the state represents
	Description string

	// Number of frames in the animation
	FrameCount int

	// Required height for the character (0 means no change)
	RequiredHeight int

	// Frame definitions (pattern code lines)
	Frames []FrameDefinition

	// Target characters ("all" or specific names)
	Targets []string

	// Template name (optional)
	Template string

	// Skip confirmation prompts
	SkipConfirmation bool

	// Skip documentation updates
	SkipDocs bool

	// Preview only (no changes)
	Preview bool

	// Dry run (show what would change)
	DryRun bool

	// Allow height updates
	AllowHeightUpdate bool

	// Custom CHANGELOG message
	ChangelogMessage string

	// Position where to insert frames ("after_base" or specific frame name)
	InsertPosition string
}

StateConfig defines the configuration for adding a new state to characters

type ValidationError

type ValidationError struct {
	Field   string
	Message string
	Value   interface{}
}

ValidationError represents a validation error with context

func (*ValidationError) Error

func (e *ValidationError) Error() string

Jump to

Keyboard shortcuts

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