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); }
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); }
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); }
// 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]); }); }