mirror of
https://github.com/Ellpeck/TinyLifeExampleMod.git
synced 2024-11-22 12:03:28 +01:00
.. | ||
TinyLife | ||
README.md |
TinyLifeApi
Namespaces
TinyLife
GameImpl
- The main class for Tiny Life, which houses a set of important game-wide properties.
Localization
- A class that houses the currently loaded language as well as allows for switching the currently selected language
Need
- A need is a desire that a
TinyLife.Objects.Person
can have to a given extent, defined byTinyLife.Need.Value
. Each need is instantiated through its associatedTinyLife.NeedType
.
- A need is a desire that a
NeedType
- A need is a desire that a
TinyLife.Objects.Person
can have to a given extent. To register a custom need type, useTinyLife.NeedType.Register(TinyLife.NeedType)
.
- A need is a desire that a
Options
- The game's options, which are displayed in the
TinyLife.Uis.Menus.InitializeOptions(MLEM.Ui.UiSystem,System.Boolean,System.Boolean)
menu and saved to disk
- The game's options, which are displayed in the
PerSaveOptions
- The game's per-save options, which are displayed in the
TinyLife.Uis.Menus.InitializeOptions(MLEM.Ui.UiSystem,System.Boolean,System.Boolean)
menu and saved to disk. Note thatTinyLife.PerSaveOptions.Instance
is null if there is noTinyLife.GameImpl.Map
loaded.
- The game's per-save options, which are displayed in the
PersonalityType
- A personality type is a trait that a
TinyLife.Objects.Person
can have. Each personality type is meant to influence the person's behavior and abilities slightly in a certain way.
- A personality type is a trait that a
Relationship
- A relationship is a connection between two
TinyLife.Objects.Person
objects. It should be noted that a relationship is not always the same between a person and the linkedTinyLife.Relationship.OtherPerson
. What this means is that A can have a good relationship to B, but B can have a less good relationship to A.
- A relationship is a connection between two
World
Door
ExportedHousehold
- This class represents an exported version of a
TinyLife.World.Household
, storing all of theTinyLife.World.Map
-independent data.
- This class represents an exported version of a
ExportedLot
- An exported lot is all of the relevant data of a
TinyLife.World.Lot
that should be exported to a file when clicking the "Export" button in the build menu. To create an exported lot from a lot, useTinyLife.World.Lot.Export
.
- An exported lot is all of the relevant data of a
Household
- A household is a set of
TinyLife.Objects.Person
instances that live together on the sameTinyLife.World.Household.Lot
- A household is a set of
IPricedObject
- A priced object is an object that has a floating point price value attached to it. In the world of Tiny Life, prices are written as "tiny bucks", but they don't necessarily resemble the prices of the American dollar.
Lot
- A lot is a designated area in the world (created using the
TinyLife.Tools.LotTool
). In the way it works, it acts similarly to a smallTinyLife.World.Map
, allowing the retrieval of various object types only in its designated area. A lot has aTinyLife.World.LotType
, which determines what things can be done on the lot.
- A lot is a designated area in the world (created using the
LotType
- A lot type is data for a
TinyLife.World.Lot
that determines the required furniture on the lot as well as whether the lot is residential or not. Additionally, custom lot types can define different reasons and interactions forTinyLife.Objects.Person
objects to visit lots of the type.
- A lot type is data for a
Map
- A map holds all of the data about a city, like its tiles, its objects and its roads. A map is split into
TinyLife.World.MapSection
objects which allows faster retrieval of objects in an area.
- A map holds all of the data about a city, like its tiles, its objects and its roads. A map is split into
MapSection
- A map section is a small area in a
TinyLife.World.MapSection.Map
that actually contains the area's objects. A map section is alwaysTinyLife.World.MapSection.Size
xTinyLife.World.MapSection.Size
tiles large.
- A map section is a small area in a
Opening
- An opening is some sort of extrusion in a
TinyLife.World.Wall
, like a window or a door. Openings are created from their underlyingTinyLife.World.OpeningType
.
- An opening is some sort of extrusion in a
OpeningType
- An opening is some sort of extrusion in a
TinyLife.World.Wall
, like a window or a door. An opening type stores data that can be used to construct aTinyLife.World.Opening
instance.
- An opening is some sort of extrusion in a
Roof
- A roof is an object on a
TinyLife.World.Map
that is on a higher level and cannot be interacted with by people
- A roof is an object on a
Room
- A room is an area on a
TinyLife.World.Room.Map
that is surrounded byTinyLife.World.Wall
objects
- A room is an area on a
Tile
- A tile is an object on a
TinyLife.World.Map
that represents the covering of the ground (or the ground itself)
- A tile is an object on a
Wall
- A wall is an element of a
TinyLife.World.Map
that stops traversal and that has aTinyLife.World.Wallpaper
and optionally anTinyLife.World.Wall.Opening
attached to it.
- A wall is an element of a
Wallpaper
- A wallpaper is a single-instanced object that can be attached to a
TinyLife.World.Wall
, which makes the wall render a different texture. To register custom wallpapers, useTinyLife.World.Wallpaper.Register(System.String,System.Int32,MLEM.Textures.UniformTextureAtlas,Microsoft.Xna.Framework.Point,TinyLife.Utilities.ColorScheme,MLEM.Textures.TextureRegion)
. Note that registered wallpapers need to use a texture generated byTinyLife.Utilities.TextureHandler.ApplyWallpaperMasks(Microsoft.Xna.Framework.Graphics.Texture2D,System.Int32,System.Int32,System.Action{MLEM.Textures.UniformTextureAtlas})
.
- A wallpaper is a single-instanced object that can be attached to a
Utilities
ColorScheme
- A color scheme is a list of
Microsoft.Xna.Framework.Color
instances with which an object can be colored. By default, a set of color schemes exist (defined in this class), but new ones can be created easily usingTinyLife.Utilities.ColorScheme.Create(System.Object[])
.
- A color scheme is a list of
Extensions
- A set of extensions for dealing with various things required by Tiny Life.
StaticJsonConverter
<T
>- A
Newtonsoft.Json.JsonConverter
1that doesn't actually serialize the object, but instead serializes the name given to it by the underlying
System.Collections.Generic.Dictionary2
.
- A
TextureHandler
- The texture handler stores data for the game's textures, including all of the game's internal textures and various utility methods. It also stores the game's
MLEM.Data.RuntimeTexturePacker
which is used to pack all textures into a big texture for performance.
- The texture handler stores data for the game's textures, including all of the game's internal textures and various utility methods. It also stores the game's
Uis
CharacterCreator
- The character creator is displayed when a person (or household) is being edited in terms of their
TinyLife.Objects.Clothes
andTinyLife.PersonalityType
s.
- The character creator is displayed when a person (or household) is being edited in terms of their
Cursor
- The Cursor class contains ways to change the
Microsoft.Xna.Framework.Input.MouseCursor
visuals to differentTinyLife.Uis.CursorType
values
- The Cursor class contains ways to change the
Notifications
- This class holds information about the current and past notifications that are displayed in the top center of the screen. To create custom notifications, use
TinyLife.Uis.Notifications.Add(TinyLife.Objects.MapObject,System.String)
orTinyLife.Uis.Notifications.Add(MLEM.Textures.TextureRegion,System.String)
.
- This class holds information about the current and past notifications that are displayed in the top center of the screen. To create custom notifications, use
Tools
FurniturePlacer
- A helper class that represents a tool part which allows the placement and movement of furniture objects. This class is used by
TinyLife.Tools.FurnitureTool
andTinyLife.Tools.MoveTool
.
- A helper class that represents a tool part which allows the placement and movement of furniture objects. This class is used by
FurnitureTool
LotTool
MoveLotTool
MoveTool
OpeningTool
PlayModeTool
RemoveTool
RoofTool
TileTool
Tool
- A tool is a type of game mode that is currently active. Tools are split up into the
TinyLife.Tools.Tool.PlayModeTool
andTinyLife.Tools.Tool.BuildTools
, the latter of which holds all tools that can be found in the build menu.
- A tool is a type of game mode that is currently active. Tools are split up into the
WallpaperTool
WallTool
Skills
FoodType
- A food type is a type of dish that can be cooked using
TinyLife.Actions.ActionType.GetIngredients
. Food types store information such as their name and texture, but also the cooking level that is required to make them. Food types are registered usingTinyLife.Skills.FoodType.Register(TinyLife.Skills.FoodType)
.
- A food type is a type of dish that can be cooked using
PaintingType
- This class represents a type of
TinyLife.Objects.Painting
that can be created using theTinyLife.Skills.SkillType.Painting
. Painting types are registered usingTinyLife.Skills.PaintingType.Register(TinyLife.Skills.PaintingType)
.
- This class represents a type of
Skill
- A skill is an ability that a
TinyLife.Objects.Person
can have which influences their behavior in some way. Skill instances are created from their correspondingTinyLife.Skills.SkillType
.
- A skill is an ability that a
SkillType
- A skill is an ability that a
TinyLife.Objects.Person
can have which influences their behavior in some way. The SkillType class contains underlying data for aTinyLife.Skills.Skill
instance, like its name and maximum level.
- A skill is an ability that a
Objects
AbstractSpot
- An
TinyLife.Objects.AbstractSpot
is a base class forTinyLife.Objects.ObjectSpot
andTinyLife.Objects.ActionSpot
.
- An
ActionSpot
- An action spot is a
TinyLife.Objects.AbstractSpot
extension that is used byTinyLife.Objects.Furniture
to declare a location that aTinyLife.Objects.Person
can interact with the furniture at
- An action spot is a
BreakableFurniture
- Breakable furniture is
TinyLife.Objects.Furniture
that can beTinyLife.Objects.BreakableFurniture.Broken
and then repaired. An object of this class is automatically returned inTinyLife.Objects.FurnitureType.Construct(System.Int32[],TinyLife.World.Map,Microsoft.Xna.Framework.Vector2,System.Nullable{System.Guid})
if noTinyLife.Objects.FurnitureType.TypeSettings.ConstructedType
is set.
- Breakable furniture is
Car
Clothes
- A set of information and a registry for clothing items (and hair) that a
TinyLife.Objects.Person
can wear. Custom clothes can be registered usingTinyLife.Objects.Clothes.Register(TinyLife.Objects.Clothes)
.
- A set of information and a registry for clothing items (and hair) that a
CornerFurniture
- Corner furniture is furniture like
TinyLife.Objects.FurnitureType.SimpleCounter
andTinyLife.Objects.FurnitureType.Hedge
that automatically connect to their neighbors
- Corner furniture is furniture like
Fence
- A fence is a furniture used by things like
TinyLife.Objects.FurnitureType.CountryFence
that auto-connects similarly toTinyLife.Objects.CornerFurniture
, but by actually adding additional connection textures onto the regular object textures
- A fence is a furniture used by things like
Food
FoodTypedItem
Furniture
- A furniture is an instance of a
TinyLife.Objects.FurnitureType
which is placed in the world, or in aTinyLife.Objects.Person
's hand. To register a custom furniture, useTinyLife.Objects.FurnitureType.Register(TinyLife.Objects.FurnitureType.TypeSettings)
.
- A furniture is an instance of a
FurnitureType
- A furniture type is basically a blueprint for
TinyLife.Objects.Furniture
objects. Each furniture type can create a furniture instance and the type's data will be transferred to the instance. Furniture types are automatically listed in theTinyLife.Tools.FurnitureTool
if registered usingTinyLife.Objects.FurnitureType.Register(TinyLife.Objects.FurnitureType.TypeSettings)
.
- A furniture type is basically a blueprint for
Gravestone
IUpdatingObject
- This is an interface that can be added to
TinyLife.Objects.MapObject
classes to make them automatically update each update frame. This is used by things likeTinyLife.Objects.Person
, which needs to update for movement etc.
- This is an interface that can be added to
MapObject
- An instance of this class represents an object that can be, or is, part of a
TinyLife.Objects.MapObject.Map
. If this object'sTinyLife.Objects.MapObject.Position
is set to -1, -1, that is usually an indicator that the object is currently not in the world.
- An instance of this class represents an object that can be, or is, part of a
ObjectSpot
- An object spot is a
TinyLife.Objects.AbstractSpot
extension that is used byTinyLife.Objects.Furniture
to declare a location that anotherTinyLife.Objects.Furniture
object can be slotted into. This behavior is used for things like plates on counters, flower pots on bedside tables etc.
- An object spot is a
Painting
Particle
- A particle is a
MLEM.Animations.SpriteAnimation
that can be moved and displayed in world space. A particle is simply aTinyLife.Objects.MapObject
that does not collide or interact directly with the world, but has all of the same properties. A new particle can be added for display usingTinyLife.Objects.Particle.Spawn(TinyLife.Objects.Particle)
.
- A particle is a
Person
- A person is a
TinyLife.Objects.MapObject
placed on aTinyLife.World.Map
that represents a person. It stores its actions, clothes, data and movement.
- A person is a
PersonAi
- This class holds the artificial intelligence implementation for a
TinyLife.Objects.Person
. The AI automatically selects actions based on theirTinyLife.Actions.ActionType.AiSettings
.
- This class holds the artificial intelligence implementation for a
ScreenObject
WornClothes
- WornClothes is a wrapper around
TinyLife.Objects.Clothes
that additionally stores the colors and whether or not the clothes are from theTinyLife.World.Household.ClothesStorage
or not
- WornClothes is a wrapper around
Mods
Events
- A set of events that can be subscribed to by mods to allow for special handling of certain situations. To have more events added to this list if they're required by your mods, please reach out to Ellpeck. Note that, for events that use an
TinyLife.Mods.EventPhase
, the subscriber needs to make sure that the code only runs for one of the phases, and not both, by checking the current phase.
- A set of events that can be subscribed to by mods to allow for special handling of certain situations. To have more events added to this list if they're required by your mods, please reach out to Ellpeck. Note that, for events that use an
Mod
- The base class for all Tiny Life mods. For an example mod, see . Mods are uniquely identified by their ID. The id is the name of the class that extends
TinyLife.Mods.Mod
.
- The base class for all Tiny Life mods. For an example mod, see . Mods are uniquely identified by their ID. The id is the name of the class that extends
ModInfo
- A mod info is a set of properties that every
TinyLife.Mods.ModInfo.Mod
instance is assigned
- A mod info is a set of properties that every
ModLoader
- The mod loader loads
TinyLife.Mods.Mod
instances from theTinyLife.Mods.ModLoader.GetModsFolder
.
- The mod loader loads
Goals
Job
- A job is a kind of work that a
TinyLife.Goals.Job.Person
can have. The person's current job is accessible usingTinyLife.Objects.Person.Job
. A job instance is constructed from its underlyingTinyLife.Goals.JobType
.
- A job is a kind of work that a
JobType
- A job type is a singleton containing various kinds of data for a
TinyLife.Goals.Job
instance. New jobs can be registered usingTinyLife.Goals.JobType.Register(TinyLife.Goals.JobType)
.
- A job type is a singleton containing various kinds of data for a
Emotions
EmotionModifier
- An emotion modifier stores information about a
TinyLife.Objects.Person
's current or past actions or events that influenced theirTinyLife.Objects.Person.Emotion
in some way. Each emotion modifier contributes to the person's emotion, and the emotion modifier with the highest combinedTinyLife.Emotions.EmotionModifier.Instance.Amount
determines the person'sTinyLife.Objects.Person.Emotion
. Emotion modifiers can be applied automatically usingTinyLife.Emotions.EmotionModifier.Condition
or manually usingTinyLife.Objects.Person.AddEmotion(TinyLife.Emotions.EmotionModifier,System.Int32,System.TimeSpan)
.
- An emotion modifier stores information about a
EmotionType
- An emotion type is a type of feeling that a
TinyLife.Objects.Person
can have. The emotion that a person has results from that person's appliedTinyLife.Emotions.EmotionModifier``TinyLife.Emotions.EmotionModifier.Instance
s.
- An emotion type is a type of feeling that a
Actions
Action
- An action is something that a
TinyLife.Objects.Person
does. An action is always derived from an underlyingTinyLife.Actions.ActionType
that contains various action settings. Actions can be queued up for a person (TinyLife.Objects.Person.ActionQueue
) or currently active (TinyLife.Objects.Person.CurrentActions
). To create a more complex action, it is best to extendTinyLife.Actions.MultiAction
.
- An action is something that a
ActionInfo
- An action info is a set of information that is required to execute an action
ActionType
- Action types are blueprints for
TinyLife.Actions.Action
instances which can be registered usingTinyLife.Actions.ActionType.Register(TinyLife.Actions.ActionType.TypeSettings)
. An action type contains information about its action and can create an instance usingTinyLife.Actions.ActionType.TypeSettings.Construct
.
- Action types are blueprints for
ActionVariety
- An action variety is a modification to a
TinyLife.Actions.ActionType
that represents a slightly changed version of the generic action type. Action varieties are used, for example, byTinyLife.Actions.ActionType.PrepareFood
to determine the kind of food that should be prepared.
- An action variety is a modification to a
ComputerAction
DriveAction
Emote
- An emote is a graphic that can be displayed in a bubble over a
TinyLife.Objects.Person
, usually as part of a conversation.
- An emote is a graphic that can be displayed in a bubble over a
GetAndSitDownAction
GoHereAction
MultiAction
- A multi action is an action that can have different actions executed before and/or after itself. This is quite useful if an action requires a
TinyLife.Objects.Person
to go somewhere to pick up an item etc.
- A multi action is an action that can have different actions executed before and/or after itself. This is quite useful if an action requires a
OutOfTownAction
- An out-of-town action is an action where the
TinyLife.Objects.Person
finds the closest exit road and then exits the city using that road. Out-of-town actions are things like going to work, where the destination location isn't visible to the player.
- An out-of-town action is an action where the
PathfindAction
- A pathfinding action is an action that first finds a path and then allows that path to be traversed. The pathfinding is done using
MLEM.Pathfinding.AStar2
.
- A pathfinding action is an action that first finds a path and then allows that path to be traversed. The pathfinding is done using
SellAction
SitAction
SitAtDeskObjectAction
SocialAction
- A social action is an action that involves two
TinyLife.Objects.Person
instances. Before a social action "actually" starts, both parties have to have the action as their current action. For this to happen, the person that initiates the action follows theTinyLife.Actions.SocialAction.Partner
until they reach them (or give up).
- A social action is an action that involves two
TalkAction
- TalkAction is a generic social action with a set of pre-defined parameters. Things like
TinyLife.PersonalityType
andTinyLife.Skills.SkillType.Charisma
automatically influence this interaction'sTinyLife.Actions.TalkAction.TalkSettings.FriendshipGain
andTinyLife.Actions.TalkAction.TalkSettings.GoBadlyChance
.TinyLife.Actions.TalkAction.Create(System.String,System.Func{TinyLife.Objects.Person,System.Int32},TinyLife.Actions.TalkAction.TalkSettings)
should be used to create a talk action.
- TalkAction is a generic social action with a set of pre-defined parameters. Things like
TellPeopleToLeaveRoomAction
UnderlyingAction
- An UnderlyingAction is a class that can instantiate a single
TinyLife.Actions.UnderlyingAction.Action
that will be executed as part of the action it is used in. Note that, when using this class,TinyLife.Actions.UnderlyingAction.Update(Microsoft.Xna.Framework.GameTime,System.TimeSpan,TinyLife.GameSpeed)
andTinyLife.Actions.UnderlyingAction.Validate(TinyLife.Objects.Person)
have to be called in the appropriate places.
- An UnderlyingAction is a class that can instantiate a single
WalkAction