ns maskis0xffff_0000_0000magicis0x4e96_0000_0000maskis0x0000_ff00_0000data maskis0x0000_00ff_ffffclass maskis0x0000_f000_0000kClassDefaultis0x0000_0000_0000kClassSupplyis0x0000_1000_0000kClassDemandis0x0000_2000_0000kIdleEmptyis0x0000_0100_0000kIdleFullis0x0000_0200_0000kSupplyFromCoreis0x0000_1100_0000kSupplyFromBlockis0x0000_1200_0000kSupplyToPointis0x0000_2000_0000encodePoint(x, y)is(x << 12) | (y << 0)
- each proc assumes a role,
:produceror:consumer, based on build --target - If consumer
- for unit in $transferUnitOfChoice
- if
unit not controlled||unit flag & ns mask = magic- if
unit flag&mask!=magic- set flag to
kIdleEmpty
- set flag to
- if
unit flag=kIdleEmpty- set flag to
kSupplyFromCore - goto core
- set flag to
- if
unit flag&class mask=kClassSupplyandunit near core- take stuff from core
- set flag to
kSupplyToPoint | current cap - goto
@this
- if
unit flag&mask=kSupplyToPointandunit flag&datamask<current cap- set flag to
kSupplyToPoint | current cap - goto
@this
- set flag to
- if
unit near @thisandunit flag&mask=kSupplyToPoint- take this goods if
unit flag&datamask<10orcurrent cap> 10
- take this goods if
- if
unit empty- set flag to
kIdleEmpty
- set flag to
- if
unit flag=kIdleFull- set flag to
kSupplyToPoint | current cap - goto
@this
- set flag to
- if
- if
- for unit in $transferUnitOfChoice
- If producer
- for unit in $transferUnitOfChoice
- if
unit not controlled||unit flag & ns mask magic- if
unit flag&mask!=magic- set flag to
kIdleEmpty
- set flag to
- if
unit flag&mask=kSupplyFromCore- if
dist(unit, core)>=dist(unit, @this)- set flag to
kSupplyFromBlock | encodePoint(@thisx, @thisy) - goto
@this
- set flag to
- if
- if
unit flag&mask=kSupplyFromBlock- Let p be
decodePoint(unit flag & data mask) - if
dist(unit, p)<dist(unit, @this)- set flag to
kSupplyFromBlock | encodePoint(@thisx, @thisy) - goto
@this
- set flag to
- Let p be
- if
unit flag&class mask=kClassSupplyandunit near @this- put shit into the unit
- set flag to
kIdleFull
- if
- if
- for unit in $transferUnitOfChoice