Skip to content

Commit

Permalink
expands + moves UnitCommand annotation to file where function that re…
Browse files Browse the repository at this point in the history
…turns it is
  • Loading branch information
clyfordv committed May 23, 2024
1 parent 29a71f1 commit b3e1d23
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
12 changes: 11 additions & 1 deletion engine/Sim/Unit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ local Unit = {}
---| "HoldingPattern"
---| "SiloBuildingAmmo"

---@class UnitCommand
---@field _c_object userdata
---@field blueprintId? string -- For build commands
---@field commandType integer -- Integer representation of CommandType, see UnitQueueDataToCommand for details
---@field target? Prop|Unit|Entity -- For commands that target an entity
---@field targetId? EntityId
---@field x number -- X coordinate of command target
---@field y number -- Y coordinate of command target
---@field z number -- Z coordinate of command target

--- Adds a command cap to the unit
---@param category moho.EntityCategory
function Unit:AddBuildRestriction(category)
Expand Down Expand Up @@ -146,7 +156,7 @@ function Unit:GetCargo()
end

--- Returns table of commands queued up for this unit
---@return { }
---@return UnitCommand[]
function Unit:GetCommandQueue()
end

Expand Down
11 changes: 0 additions & 11 deletions lua/sim/Unit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,6 @@ SyncMeta = {
---@field AdjEnergyMod? number
---@field AdjRoFMod? number

---@class UnitCommand
---@field x number
---@field y number
---@field z number
---@field targetId? EntityId
---@field target? Entity
---@field commandType string

---@class AIUnitProperties
---@field AIPlatoonReference AIPlatoon
---@field AIBaseManager LocationType
Expand Down Expand Up @@ -2809,9 +2801,6 @@ Unit = ClassUnit(moho.unit_methods, IntelComponent, VeterancyComponent) {

if order == 'Repair' then
self:OnStartRepair(built)
elseif self:GetHealth() < self:GetMaxHealth() and not table.empty(self:GetGuards()) then
-- Unit building something is damaged and has assisters, check their focus
self:CheckAssistersFocus()
end

if order ~= 'Upgrade' or bpSelf.Display.ShowBuildEffectsDuringUpgrade then
Expand Down

0 comments on commit b3e1d23

Please sign in to comment.