How to do it...

Now, we just need to modify some files and add functionalities:

  1. Include the guild member in the VertexInfluence class:
public Guild guild; 
  1. Include new members in the InfluenceMap class:
public float dropOffThreshold; 
private  Guild[] guildList; 
  1. Also, in InfluenceMap, add the following line to the Awake function:
guildList = gameObject.GetComponents<Guild>(); 
  1. Create the map flooding function:
public List<GuildRecord> ComputeMapFlooding() 
{ 
} 
  1. Declare the principal necessary variables:
GPWiki.BinaryHeap<GuildRecord> open; 
open = new GPWiki.BinaryHeap<GuildRecord>(); 
List<GuildRecord> closed; 
closed = new List<GuildRecord>(); 
  1. Add the initial nodes for each guild in the priority queue:
foreach (Guild g in guildList) ...

Get Unity 2018 Artificial Intelligence Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.