Game.EndFrameBarrier
Assembly: Game.Modding.Toolchain
Namespace: Game.Modding.Toolchain
Type: public enum
Base: System.Enum
Summary:
This documentation describes the DeploymentAction enum defined in Game.Modding.Toolchain. DeploymentAction is a Flags enum used by the modding toolchain to represent one or more deployment-related operations (installing, updating, repairing, or uninstalling mods). Each member is intended to be combined using bitwise operations to represent multiple actions at once. Note that the numeric values chosen are explicit and include a skipped bit (1 is unused), so code should rely on the named flags rather than hardcoded numeric values.
Fields
-
None = 0
Represents no action. This is the default value for the enum. -
Install = 2
Represents an install action. Use this flag when a mod should be installed to the target location. -
Update = 4
Represents an update action. Use this flag when a mod should be updated (existing files replaced/merged). -
Repair = 8
Represents a repair action. Use this flag when a mod should be repaired (fix corrupted or missing files). -
Uninstall = 0x10
(16)
Represents an uninstall action. Use this flag when a mod should be removed from the target location.
Notes: - The enum is decorated with [Flags], so values are intended to be combined (for example, Install | Update). - The value 1 is not assigned to any member in this definition; do not assume contiguous power-of-two ordering.
Properties
- This enum type defines no custom properties. Standard enum behaviours and System.Enum APIs apply.
Constructors
- Enums do not have explicit constructors. The default value (when a variable of this type is initialized without assignment) is
None
(0).
Methods
- No custom methods are defined on this enum. Use the System.Enum static and instance methods as needed (e.g., Enum.HasFlag, Enum.ToString). For flag checks, prefer bitwise operations for performance-critical code:
- (actions & DeploymentAction.Install) != 0
- actions.HasFlag(DeploymentAction.Install) (simpler, slightly slower)
Usage Example
// Combine actions to perform both install and update
DeploymentAction actions = DeploymentAction.Install | DeploymentAction.Update;
// Check for a specific flag (preferred bitwise check in performance-sensitive code)
if ((actions & DeploymentAction.Install) != 0)
{
// perform install logic
}
// Or use HasFlag for readability
if (actions.HasFlag(DeploymentAction.Update))
{
// perform update logic
}
// Add another action (e.g., also repair)
actions |= DeploymentAction.Repair;
// Remove a flag (e.g., no longer want to update)
actions &= ~DeploymentAction.Update;
{{ This enum is part of the modding toolchain for Cities: Skylines 2 and is used by deployment utilities to express which operations should be performed on mod packages. When extending toolchain logic, check for combinations of these flags rather than relying on single-value comparisons. Always handle the None case explicitly and be aware that numeric values may be preserved for compatibility; do not assume an unused bit will remain unused in future versions. }}