models

package
v0.0.0-...-790c85d Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoundingBox

type BoundingBox struct {
	XMLName  xml.Name `xml:"boundingBox"`
	X        int      `xml:"X"`
	Y        int      `xml:"Y"`
	Width    int      `xml:"Width"`
	Height   int      `xml:"Height"`
	Location Position `xml:"Location"`
}

type Color

type Color struct {
	R           int   `xml:"R"`
	G           int   `xml:"G"`
	B           int   `xml:"B"`
	A           int   `xml:"A"`
	PackedValue int64 `xml:"PackedValue"`
}

func (*Color) String

func (c *Color) String() string

type DishOfTheDay

type DishOfTheDay struct {
	XMLName xml.Name `xml:"dishOfTheDay"`
}

type GameLocation

type GameLocation struct {
	XMLName                     xml.Name `xml:"GameLocation"`
	Type                        string   `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
	Name                        string   `xml:"name"`
	WaterColor                  Color    `xml:"waterColor"`
	IsFarm                      bool     `xml:"isFarm"`
	IsOutdoors                  bool     `xml:"isOutdoors"`
	IsGreenhouse                bool     `xml:"isGreenhouse"`
	IsStructure                 bool     `xml:"isStructure"`
	IgnoreDebrisWeather         bool     `xml:"ignoreDebrisWeather"`
	IgnoreOutdoorLighting       bool     `xml:"ignoreOutdoorLighting"`
	IgnoreLights                bool     `xml:"ignoreLights"`
	TreatAsOutdoors             bool     `xml:"treatAsOutdoors"`
	NumberOfSpawnedObjectsOnMap int      `xml:"numberOfSpawnedObjectsOnMap"`
}

type HeldObject

type HeldObject struct {
	XMLName                   xml.Name    `xml:"heldObject"`
	BoundingBox               BoundingBox `xml:"boundingBox"`
	Scale                     Position    `xml:"scale"`
	ParentSheetIndex          int         `xml:"parentSheetIndex"`
	Category                  int         `xml:"category"`
	Name                      string      `xml:"name"`
	Name2                     string      `xml:"Name"`
	SpecialItem               bool        `xml:"specialItem"`
	HasBeenInInventory        bool        `xml:"hasBeenInInventory"`
	SpecialVariable           int         `xml:"SpecialVariable"`
	DisplayName               string      `xml:"DisplayName"`
	Stack                     int         `xml:"Stack"`
	Stack2                    int         `xml:"stack"`
	IsRecipe                  bool        `xml:"isRecipe"`
	BigCraftable              bool        `xml:"bigCraftable"`
	Type                      string      `xml:"type"`
	TileLocation              Position    `xml:"tileLocation"`
	Owner                     int         `xml:"owner"`
	CanBeSetDown              bool        `xml:"canBeSetDown"`
	CanBeGrabbed              bool        `xml:"canBeGrabbed"`
	IsHoeDirt                 bool        `xml:"isHoedirt"`
	IsSpawnedObject           bool        `xml:"isSpawnedObject"`
	QuestItem                 bool        `xml:"questItem"`
	QuestID                   int         `xml:"questId"`
	IsOn                      bool        `xml:"isOn"`
	Fragility                 int         `xml:"fragility"`
	Price                     int         `xml:"price"`
	Edibility                 int         `xml:"edibility"`
	Quality                   int         `xml:"quality"`
	SetOutdoors               bool        `xml:"setOutdoors"`
	SetIndoors                bool        `xml:"setIndoors"`
	IsReadyForHarvest         bool        `xml:"readyForHarvest"`
	ShowNextIndex             bool        `xml:"showNextIndex"`
	IsFlipped                 bool        `xml:"flipped"`
	HasBeenPickedUpByFarmer   bool        `xml:"hasBeenPickedUpByFarmer"`
	IsLamp                    bool        `xml:"isLamp"`
	MinutesUntilReady         int         `xml:"minutesUntilReady"`
	Uses                      int         `xml:"uses"`
	PreservedParentSheetIndex int         `xml:"preservedParentSheetIndex"`
}

type IntValue

type IntValue struct {
	XMLName xml.Name `xml:"value"`
	Int     int      `xml:"int"`
}

type Item

type Item struct {
	XMLName xml.Name `xml:"item"`
	Key     StringKey
	Value   IntValue
}

func (*Item) String

func (i *Item) String() string

type Object

type Object struct {
	XMLName                   xml.Name    `xml:"Object"`
	ParentSheetIndex          int         `xml:"parentSheetIndex"`
	Category                  int         `xml:"category"`
	Name                      string      `xml:"name"`
	SpecialItem               bool        `xml:"specialItem"`
	HasBeenInInventory        bool        `xml:"hasBeenInInventory"`
	SpecialVariable           int         `xml:"SpecialVariable"`
	DisplayName               string      `xml:"DisplayName"`
	Name2                     string      `xml:"Name"`
	Stack                     int         `xml:"Stack"`
	IsRecipe                  bool        `xml:"isRecipe"`
	BigCraftable              bool        `xml:"bigCraftable"`
	Type                      string      `xml:"type"`
	TileLocation              Position    `xml:"tileLocation"`
	Owner                     int         `xml:"owner"`
	CanBeSetDown              bool        `xml:"canBeSetDown"`
	CanBeGrabbed              bool        `xml:"canBeGrabbed"`
	IsHoedirt                 bool        `xml:"isHoedirt"`
	IsSpawnedObject           bool        `xml:"isSpawnedObject"`
	QuestItem                 bool        `xml:"questItem"`
	QuestID                   int         `xml:"questId"`
	IsOn                      bool        `xml:"isOn"`
	Fragility                 int         `xml:"fragility"`
	Price                     int         `xml:"price"`
	Edibility                 int         `xml:"edibility"`
	Stack2                    int         `xml:"stack"`
	Quality                   int         `xml:"quality"`
	SetOutdoors               bool        `xml:"setOutdoors"`
	SetIndoors                bool        `xml:"setIndoors"`
	IsReadyForHarvest         bool        `xml:"readyForHarvest"`
	ShowNextIndex             bool        `xml:"showNextIndex"`
	IsFlipped                 bool        `xml:"flipped"`
	HasBeenPickedUpByFarmer   bool        `xml:"hasBeenPickedUpByFarmer"`
	IsLamp                    bool        `xml:"isLamp"`
	HeldObject                HeldObject  `xml:"heldObject"`
	MinutesUntilReady         int         `xml:"minutesUntilReady"`
	BoundingBox               BoundingBox `xml:"boundingBox"`
	Scale                     Scale       `xml:"scale"`
	Uses                      int         `xml:"uses"`
	PreservedParentSheetIndex int         `xml:"preservedParentSheetIndex"`
}

type Options

type Options struct {
	XMLName xml.Name `xml:"options"`
}

type Player

type Player struct {
	XMLName                     xml.Name    `xml:"player"`
	Name                        string      `xml:"name"`
	FarmName                    string      `xml:"farmName"`
	IsEmoting                   bool        `xml:"isEmoting"`
	IsEmoting2                  bool        `xml:"IsEmoting"`
	FavoriteThing               string      `xml:"favoriteThing"`
	HorseName                   string      `xml:"horseName"`
	CatPerson                   bool        `xml:"catPerson"`
	CurrentEmote                int         `xml:"currentEmote"`
	IsCharging                  bool        `xml:"isCharging"`
	WillDestroyObjectsUnderfoot bool        `xml:"willDestroyObjectsUnderfoot"`
	IsGlowing                   bool        `xml:"isGlowing"`
	ColoredBorder               bool        `xml:"coloredBorder"`
	Flip                        bool        `xml:"flip"`
	DrawOnTop                   bool        `xml:"drawOnTop"`
	FaceTowardFarmer            bool        `xml:"faceTowardFarmer"`
	FaceAwayFromFarmer          bool        `xml:"faceAwayFromFarmer"`
	IgnoreMovementAnimation     bool        `xml:"ignoreMovementAnimation"`
	TimeBeforeAIMovementAgain   int         `xml:"timeBeforeAIMovementAgain"`
	GlowingTransparency         float32     `xml:"glowingTransparency"`
	GlowRate                    float32     `xml:"glowRate"`
	Speed                       int         `xml:"speed"`
	FacingDirection             int         `xml:"facingDirection"`
	Scale                       int         `xml:"scale"`
	Professions                 Professions `xml:"professions"`
	ExperiencePoints            []int       `xml:"experiencePoints"`
	DialogueQuestionsAnswered   []int       `xml:"dialogueQuestionsAnswered"`
	EventsSeen                  []int       `xml:"eventsSeen"`
	SecretNotesSeen             []int       `xml:"secretNotesSeen"`
	SongsHeard                  []string    `xml:"songsHeard"`
	Achievements                []int       `xml:"achievements"`
	SpecialItems                []int       `xml:"specialItems"`
	SpecialBigCraftables        []int       `xml:"specialBigCraftables"`
	MailReceived                []string    `xml:"mailReceived"`
	SlotCanHost                 bool        `xml:"slotCanHost"`
	Shirt                       int         `xml:"shirt"`
	Hair                        int         `xml:"hair"`
	Skin                        int         `xml:"skin"`
	Shoes                       int         `xml:"shoes"`
	Accessory                   int         `xml:"accessory"`
	FacialHair                  int         `xml:"facialHair"`
	DivorceTonight              bool        `xml:"divorceTonight"`
	WoodPieces                  int         `xml:"woodPieces"`
	StonePieces                 int         `xml:"stonePieces"`
	CopperPieces                int         `xml:"copperPieces"`
	IronPieces                  int         `xml:"ironPieces"`
	CoalPieces                  int         `xml:"coalPieces"`
	GoldPieces                  int         `xml:"goldPieces"`
	IridiumPieces               int         `xml:"iridiumPieces"`
	QuartzPieces                int         `xml:"quartzPieces"`
	CaveChoice                  int         `xml:"caveChoice"`
	Feed                        int         `xml:"feed"`
	FarmingLevel                int         `xml:"farmingLevel"`
	MiningLevel                 int         `xml:"miningLevel"`
	CombatLevel                 int         `xml:"combatLevel"`
	ForagingLevel               int         `xml:"foragingLevel"`
	FishingLevel                int         `xml:"fishingLevel"`
	LuckLevel                   int         `xml:"luckLevel"`
	NewSkillPointsToSpend       int         `xml:"newSkillPointsToSpend"`
	AddedFarmingLevel           int         `xml:"addedFarmingLevel"`
	AddedMiningLevel            int         `xml:"addedMiningLevel"`
	AddedCombatLevel            int         `xml:"addedCombatLevel"`
	AddedForagingLevel          int         `xml:"addedForagingLevel"`
	AddedFishingLevel           int         `xml:"addedFishingLevel"`
	AddedLuckLevel              int         `xml:"addedLuckLevel"`
	Inventory                   PlayerItems `xml:"items"`
	Position                    Position
	CookingRecipes              []Recipe
	CraftingRecipes             []Recipe
	Stats                       PlayerStats
	MostRecentBed               Position
	HairstyleColor              Color
	PantsColor                  Color
	EyeColor                    Color `xml:"newEyeColor"`
	ID                          int64 `xml:"UniqueMultiplayerID"`
}

func (*Player) String

func (p *Player) String() string

type PlayerItem

type PlayerItem struct {
	XMLName                 xml.Name `xml:"Item"`
	Type                    string   `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
	IsNil                   bool     `xml:"http://www.w3.org/2001/XMLSchema-instance nil,attr"`
	Category                int      `xml:"category"`
	Name                    string   `xml:"name"`
	SpecificName            string   `xml:"Name"`
	DisplayName             string   `xml:"DisplayName"`
	BaseName                string   `xml:"BaseName"`
	SpecialItem             bool     `xml:"specialItem"`
	HasBeenInInventory      bool     `xml:"hasBeenInInventory"`
	SpecialVariable         int      `xml:"SpecialVariable"`
	Stack                   int      `xml:"Stack"`
	InitialParentTileIndex  int      `xml:"initialParentTileIndex"`
	InitialParentTileIndex2 int      `xml:"InitialParentTileIndex"`
	CurrentParentTileIndex  int      `xml:"currentParentTileIndex"`
	IndexOfMenuItemView     int      `xml:"indexOfMenuItemView"`
	IndexOfMenuItemView2    int      `xml:"IndexOfMenuItemView"`
	Stackable               bool     `xml:"stackable"`
	Stackable2              bool     `xml:"Stackable"`
	InstantUse              bool     `xml:"instantUse"`
	InstantUse2             bool     `xml:"InstantUse"`
	UpgradeLevel            int      `xml:"upgradeLevel"`
	NumAttachmentSlots      int      `xml:"numAttachmentSlots"`
	WaterCanMax             int      `xml:"waterCanMax"`
	WaterLeft               int      `xml:"WaterLeft"`
}

func (*PlayerItem) String

func (i *PlayerItem) String() string

type PlayerItems

type PlayerItems struct {
	XMLName xml.Name     `xml:"items"`
	Items   []PlayerItem `xml:"Item"`
}

func (*PlayerItems) String

func (pi *PlayerItems) String() string

func (*PlayerItems) Total

func (pi *PlayerItems) Total() int

type PlayerStats

type PlayerStats struct {
	XMLName                xml.Name `xml:"stats"`
	SeedsSown              int      `xml:"seedsSown"`
	ItemsShipped           int      `xml:"itemsShipped"`
	ItemsCooked            int      `xml:"itemsCooked"`
	ItemsCrafted           int      `xml:"itemsCrafted"`
	ChickenEggsLayed       int      `xml:"chickenEggsLayed"`
	DuckEggsLayed          int      `xml:"duckEggsLayed"`
	CowMilkProduced        int      `xml:"cowMilkProduced"`
	GoatMilkProduced       int      `xml:"goatMilkProduced"`
	RabbitWoolProduced     int      `xml:"rabbitWoolProduced"`
	SheepWoolProduced      int      `xml:"sheepWoolProduced"`
	CheeseMade             int      `xml:"cheeseMade"`
	GoatCheeseMade         int      `xml:"goatCheeseMade"`
	TrufflesFound          int      `xml:"trufflesFound"`
	StoneGathered          int      `xml:"stoneGathered"`
	RocksCrushed           int      `xml:"rocksCrushed"`
	DirtHoed               int      `xml:"dirtHoed"`
	GiftsGiven             int      `xml:"giftsGiven"`
	TimesUnconscious       int      `xml:"timesUnconscious"`
	TimesUnconscious2      int      `xml:"TimesUnconscious"`
	AverageBedtime         int      `xml:"averageBedtime"`
	TimesFished            int      `xml:"timesFished"`
	FishCaught             int      `xml:"fishCaught"`
	BouldersCracked        int      `xml:"bouldersCracked"`
	BouldersCracked2       int      `xml:"BouldersCracked"`
	StumpsChopped          int      `xml:"stumpsChopped"`
	StepsTaken             int      `xml:"stepsTaken"`
	TotalMonstersKilled    int      `xml:"monstersKilled"`
	TotalMonstersKilled2   int      `xml:"MonstersKilled"`
	MonstersKilled         SpecificMonstersKilled
	DiamondsFound          int `xml:"diamondsFound"`
	PrismaticShardsFound   int `xml:"prismaticShardsFound"`
	OtherPreciousGemsFound int `xml:"otherPreciousGemsFound"`
	CaveCarrotsFound       int `xml:"caveCarrotsFound"`
	CopperFound            int `xml:"copperFound"`
	IronFound              int `xml:"ironFound"`
	CoalFound              int `xml:"coalFound"`
	CoinsFound             int `xml:"coinsFound"`
	GoldFound              int `xml:"goldFound"`
	IridiumFound           int `xml:"iridiumFound"`
	BarsSmelted            int `xml:"barsSmelted"`
	BeveragesMade          int `xml:"beveragesMade"`
	PreservesMade          int `xml:"preservesMade"`
	PiecesOfTrashRecycled  int `xml:"piecesOfTrashRecycled"`
	MysticStonesCrushed    int `xml:"mysticStonesCrushed"`
	DaysPlayed             int `xml:"daysPlayed"`
	WeedsEliminated        int `xml:"weedsEliminated"`
	SticksChopped          int `xml:"sticksChopped"`
	NotesFound             int `xml:"notesFound"`
	QuestsCompleted        int `xml:"questsCompleted"`
	StarLevelCropsShipped  int `xml:"starLevelCropsShipped"`
	CropsShipped           int `xml:"cropsShipped"`
	ItemsForaged           int `xml:"itemsForaged"`
	SlimesKilled           int `xml:"slimesKilled"`
	GeodesCracked          int `xml:"geodesCracked"`
	GoodFriends            int `xml:"goodFriends"`
}

func (*PlayerStats) Counts

func (s *PlayerStats) Counts() map[string]int

func (*PlayerStats) String

func (s *PlayerStats) String() string

type Position

type Position struct {
	X int `xml:"X"`
	Y int `xml:"Y"`
}

type Professions

type Professions struct {
	XMLName xml.Name `xml:"professions"`
	Values  []int    `xml:"int"`
}

func (*Professions) String

func (p *Professions) String() string

type Recipe

type Recipe struct {
	Key   StringKey
	Value IntValue
}

type SaveFile

type SaveFile struct {
	Path string
	Data *SaveGame
}

SaveFile represents a Stardew Valley save file.

func NewSaveFile

func NewSaveFile(path string) *SaveFile

NewSaveFile returns a SaveFile for the Stardew Valley save at the given file path.

func (*SaveFile) Load

func (s *SaveFile) Load() error

Load opens a save file for editing.

func (*SaveFile) Read

func (s *SaveFile) Read() (string, error)

Read reads a save file as an XML string.

func (*SaveFile) Save

func (s *SaveFile) Save(path string, indent bool) error

Save the save file to the specified path as an XML file.

func (*SaveFile) ToXML

func (s *SaveFile) ToXML(indent bool) ([]byte, error)

ToXML returns a byte array of the save file as XML.

type SaveGame

type SaveGame struct {
	XMLName                xml.Name `xml:"SaveGame"`
	Player                 Player
	Locations              []GameLocation
	CurrentSeason          string `xml:"currentSeason"`
	SamBandName            string `xml:"samBandName"`
	ElliottBookName        string `xml:"elliottBookName"`
	DayOfMonth             int    `xml:"dayOfMonth"`
	Year                   int    `xml:"year"`
	FarmerWallpaper        int    `xml:"farmerWallpaper"`
	FarmerFloor            string `xml:"FarmerFloor"`
	CurrentWallpaper       int    `xml:"currentWallpaper"`
	CurrentFloor           int    `xml:"currentFloor"`
	ID                     int64  `xml:"uniqueIDForThisGame"`
	Has13Update            bool   `xml:"hasApplied1_3_UpdateChanges"`
	IncubatingEgg          Position
	CurrentSongIndex       int     `xml:"currentSongIndex"`
	ChanceToRainTomorrow   float32 `xml:"chanceToRainTomorrow"`
	DailyLuck              float32 `xml:"dailyLuck"`
	WeddingToday           bool    `xml:"weddingToday"`
	IsRaining              bool    `xml:"isRaining"`
	IsDebrisWeather        bool    `xml:"isDebrisWeather"`
	ShippingTax            bool    `xml:"shippingTax"`
	BloomDay               bool    `xml:"bloomDay"`
	IsLightning            bool    `xml:"isLightning"`
	IsSnowing              bool    `xml:"isSnowing"`
	ShouldSpawnMonsters    bool    `xml:"shouldSpawnMonsters"`
	MusicVolume            float32 `xml:"musicVolume"`
	SoundVolume            float32 `xml:"soundVolume"`
	CropsOfTheWeek         []int   `xml:"cropsOfTheWeek"`
	LatestID               int64   `xml:"latestID"`
	MinecartHighScore      int     `xml:"minecartHighScore"`
	WeatherForTomorrow     int     `xml:"weatherForTomorrow"`
	DishOfTheDay           DishOfTheDay
	Options                Options
	LowestMineLevelReached int `xml:"mine_lowestLevelReached"`
	FarmType               int `xml:"whichFarm"`
}

func (*SaveGame) String

func (s *SaveGame) String() string

type Scale

type Scale struct {
	XMLName xml.Name `xml:"scale"`
	X       float32  `xml:"X"`
	Y       float32  `xml:"Y"`
}

type SpecificMonstersKilled

type SpecificMonstersKilled struct {
	XMLName xml.Name `xml:"specificMonstersKilled"`
	Items   []Item   `xml:"item"`
}

func (*SpecificMonstersKilled) Counts

func (m *SpecificMonstersKilled) Counts() map[string]int

func (*SpecificMonstersKilled) String

func (m *SpecificMonstersKilled) String() string

type StringKey

type StringKey struct {
	XMLName xml.Name `xml:"key"`
	String  string   `xml:"string"`
}

Jump to

Keyboard shortcuts

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