Example #1
0
    private void CSBuildUpgrade(IMessage data, Player player)
    {
        CSBuildUpgrade protocol = data as CSBuildUpgrade;
        ModMap         mod      = player.GetModule <ModMap>(ModuleIdx.Map);

        mod.BuildUpgrade(protocol.MapName, protocol.GridId);
    }
Example #2
0
    private void CSTerrainBuy(IMessage data, Player player)
    {
        CSTerrainBuy protocol = data as CSTerrainBuy;
        ModMap       mod      = player.GetModule <ModMap>(ModuleIdx.Map);

        mod.TerrainBuy(protocol.MapName, protocol.GridId);
    }
Example #3
0
    private void CSBuildAdd(IMessage data, Player player)
    {
        CSBuildAdd protocol = data as CSBuildAdd;
        ModMap     mod      = player.GetModule <ModMap>(ModuleIdx.Map);

        mod.BuildAdd(protocol.MapName, protocol.GridId, protocol.DataId, protocol.Direction);
    }
 /// <summary>
 ///     Registers item with it
 /// </summary>
 /// <param name="itemId">ID of the item to register</param>
 /// <param name="item">Item to register</param>
 /// <param name="mod">Owning mod, defaults to null</param>
 public static void RegisterItem(string itemId, ModMap item, ModManifest mod = null)
 {
     RegistryInstance.RegisterItem(mod == null ? itemId : GetModSpecificId(mod, itemId), item);
 }
Example #5
0
 // Take as a parameter the delegate. The Map function must use the
 // Parallel class to execute the delegate map function in parallel.
 public void Map(ModMap mm)
 {
     Parallel.For(0, 10, i => {
         data[i] = mm(data[i]);
     });
 }