全站通知:

LandfillSiteAI

阅读

    

2023-11-30更新

    

最新编辑:Lu_23333

阅读:

  

更新日期:2023-11-30

  

最新编辑:Lu_23333

来自城市:天际线WIKI_BWIKI_哔哩哔哩
跳到导航 跳到搜索
页面贡献者 :
xl123071
Lu_23333
施工中:欢迎协助编辑本页,请参考帮助:编辑帮助帮助:编辑规范。请从以下方面协助编辑:
  • 需要翻译

LandfillSiteAI is a class extending PlayerBuildingAI representing garbage collection buildings.

Behaviour

Fill state

The current fill state of the landfill is calculated like so

int garbageCount = (int) buildingData.m_customBuffer1 * 1000 + (int) buildingData.m_garbageBuffer;
bool full = (garbageCount >= this.m_garbageCapacity);

And is set like so

data.m_customBuffer1 = (ushort) (garbageCount / 1000);
data.m_garbageBuffer = (ushort) (garbageCount - (int) data.m_customBuffer1 * 1000);

Collecting garbage

The ProduceGoods method lists transfer offers for garbage collection. As you can see the Priority is based on the number of owned vehicles with a transfer type of TransferReason.Garbage

Singleton<TransferManager>.instance.AddIncomingOffer(
  TransferManager.TransferReason.Garbage,
  new TransferManager.TransferOffer() {
    Priority = 2 - ownedGarbageTruckCount,
    Building = buildingID,
    Position = buildingData.m_position,
    Amount = 1,
    Active = true
  }
);
说明

本文内容长期有效,适用任何游戏版本。

本页内容最初译自官方Wiki:LandfillSiteAI,经双方编辑后内容可能与来源不同。