Opened 3 years ago

Closed 3 years ago

#5884 closed enhancement (fixed)

Move (remaining) Can* functions in UnitAI to their respective components.

Reported by: Freagarach Owned by:
Priority: Nice to Have Milestone: Alpha 25
Component: Simulation Keywords:
Cc: Patch: Phab:D3638

Description

E.g. UnitAI.prototype.CanAttack = function(target) defers the question to cmpAttack. Similar things can be done for garrison gather and returnResource. (Build / Repair is more difficult.)

Why? This reduces duplication and eases code maintenance by also reducing UnitAI complexity (a bit).

Change History (3)

comment:1 by Freagarach, 3 years ago

Type: defectenhancement

comment:2 by Freagarach, 3 years ago

Patch: Phab:D3638

Garrison.

comment:3 by Freagarach, 3 years ago

Keywords: simple UnitAI removed
Resolution: fixed
Status: newclosed

In r25139:

Move Can*-function implementations from UnitAI to their respective components.

Makes for less duplicated logic, easier modding and better split responsibilities.

Differential revision: D3638
Closes: #5884

Note: See TracTickets for help on using tickets.