本文整理汇总了C#中IGameMode类的典型用法代码示例。如果您正苦于以下问题:C# IGameMode类的具体用法?C# IGameMode怎么用?C# IGameMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IGameMode类属于命名空间,在下文中一共展示了IGameMode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CSharpScriptExecutor
/// <summary>
/// A simple constructor that initializes the object with the given values.
/// </summary>
/// <param name="p_gmdGameMode">The game mode currently being managed.</param>
/// <param name="p_eifEnvironmentInfo">The application's envrionment info.</param>
/// <param name="p_csfFunctions">The proxy providing the implementations of the functions available to the C# script.</param>
/// <param name="p_tpeBaseScriptType">The type of the base script from which all C# scripts should derive.</param>
public CSharpScriptExecutor(IGameMode p_gmdGameMode, IEnvironmentInfo p_eifEnvironmentInfo, CSharpScriptFunctionProxy p_csfFunctions, Type p_tpeBaseScriptType)
{
m_gmdGameMode = p_gmdGameMode;
m_eifEnvironmentInfo = p_eifEnvironmentInfo;
m_csfFunctions = p_csfFunctions;
BaseScriptType = p_tpeBaseScriptType;
}
开发者ID:NexusMods,项目名称:NexusModManager-4.5,代码行数:14,代码来源:CSharpScriptExecutor.cs
示例2: Initialize
/// <summary>
/// Initializes the singleton intances of the mod manager.
/// </summary>
/// <param name="p_gmdGameMode">The current game mode.</param>
/// <param name="p_mprManagedPluginRegistry">The <see cref="PluginRegistry"/> that contains the list
/// of managed <see cref="Plugin"/>s.</param>
/// <param name="p_aplPluginLog">The <see cref="ActivePluginLog"/> tracking plugin activations for the
/// current game mode.</param>
/// <param name="p_polOrderLog">The <see cref="IPluginOrderLog"/> tracking plugin order for the
/// current game mode.</param>
/// <param name="p_povOrderValidator">The object that validates plugin order.</param>
/// <exception cref="InvalidOperationException">Thrown if the plugin manager has already
/// been initialized.</exception>
public static IPluginManager Initialize(IGameMode p_gmdGameMode, PluginRegistry p_mprManagedPluginRegistry, ActivePluginLog p_aplPluginLog, IPluginOrderLog p_polOrderLog, IPluginOrderValidator p_povOrderValidator)
{
if (m_pmgCurrent != null)
throw new InvalidOperationException("The Plugin Manager has already been initialized.");
m_pmgCurrent = new PluginManager(p_gmdGameMode, p_mprManagedPluginRegistry, p_aplPluginLog, p_polOrderLog, p_povOrderValidator);
return m_pmgCurrent;
}
开发者ID:NexusMods,项目名称:NexusModManager-4.5,代码行数:20,代码来源:PluginManager.cs
示例3: Initialize
/// <summary>
/// Initializes the singleton intances of the mod manager.
/// </summary>
/// <param name="p_gmdGameMode">The current game mode.</param>
/// <param name="p_eifEnvironmentInfo">The application's envrionment info.</param>
/// <param name="p_mrpModRepository">The mod repository from which to get mods and mod metadata.</param>
/// <param name="p_dmrMonitor">The download monitor to use to track task progress.</param>
/// <param name="p_frgFormatRegistry">The <see cref="IModFormatRegistry"/> that contains the list
/// of supported <see cref="IModFormat"/>s.</param>
/// <param name="p_mrgModRegistry">The <see cref="ModRegistry"/> that contains the list
/// of managed <see cref="IMod"/>s.</param>
/// <param name="p_futFileUtility">The file utility class.</param>
/// <param name="p_scxUIContext">The <see cref="SynchronizationContext"/> to use to marshall UI interactions to the UI thread.</param>
/// <param name="p_ilgInstallLog">The install log tracking mod activations for the current game mode.</param>
/// <param name="p_pmgPluginManager">The plugin manager to use to work with plugins.</param>
/// <returns>The initialized mod manager.</returns>
/// <exception cref="InvalidOperationException">Thrown if the mod manager has already
/// been initialized.</exception>
public static ModManager Initialize(IGameMode p_gmdGameMode, IEnvironmentInfo p_eifEnvironmentInfo, IModRepository p_mrpModRepository, DownloadMonitor p_dmrMonitor, ActivateModsMonitor p_ammMonitor, IModFormatRegistry p_frgFormatRegistry, ModRegistry p_mrgModRegistry, FileUtil p_futFileUtility, SynchronizationContext p_scxUIContext, IInstallLog p_ilgInstallLog, IPluginManager p_pmgPluginManager)
{
if (m_mmgCurrent != null)
throw new InvalidOperationException("The Mod Manager has already been initialized.");
m_mmgCurrent = new ModManager(p_gmdGameMode, p_eifEnvironmentInfo, p_mrpModRepository, p_dmrMonitor, p_ammMonitor, p_frgFormatRegistry, p_mrgModRegistry, p_futFileUtility, p_scxUIContext, p_ilgInstallLog, p_pmgPluginManager);
return m_mmgCurrent;
}
开发者ID:etinquis,项目名称:nexusmodmanager,代码行数:25,代码来源:ModManager.cs
示例4: BasicUninstallTask
/// <summary>
/// A simple constructor that initializes the object with the given values.
/// </summary>
/// <param name="p_modMod">The mod being installed.</param>
/// <param name="p_igpInstallers">The utility class to use to install the mod items.</param>
/// <param name="p_ilgModInstallLog">The install log that tracks mod install info
/// for the current game mode</param>
/// <param name="p_gmdGameMode">The the current game mode.</param>
/// <param name="p_rolActiveMods">The list of active mods.</param>
public BasicUninstallTask(IMod p_modMod, InstallerGroup p_igpInstallers, IInstallLog p_ilgModInstallLog, IGameMode p_gmdGameMode, ReadOnlyObservableList<IMod> p_rolActiveMods)
{
Mod = p_modMod;
Installers = p_igpInstallers;
ModInstallLog = p_ilgModInstallLog;
GameMode = p_gmdGameMode;
ActiveMods = p_rolActiveMods;
}
开发者ID:etinquis,项目名称:nexusmodmanager,代码行数:17,代码来源:BasicUninstallTask.cs
示例5: XmlScriptExecutor
/// <summary>
/// A simple constructor that initializes the object with the required dependencies.
/// </summary>
/// <param name="p_modMod">The mod for which the script is running.</param>
/// <param name="p_gmdGameMode">The game mode currently being managed.</param>
/// <param name="p_eifEnvironmentInfo">The application's envrionment info.</param>
/// <param name="p_igpInstallers">The utility class to use to install the mod items.</param>
/// <param name="p_scxUIContext">The <see cref="SynchronizationContext"/> to use to marshall UI interactions to the UI thread.</param>
public XmlScriptExecutor(IMod p_modMod, IGameMode p_gmdGameMode, IEnvironmentInfo p_eifEnvironmentInfo, InstallerGroup p_igpInstallers, SynchronizationContext p_scxUIContext)
{
m_scxSyncContext = p_scxUIContext;
Mod = p_modMod;
GameMode = p_gmdGameMode;
EnvironmentInfo = p_eifEnvironmentInfo;
Installers = p_igpInstallers;
}
开发者ID:NexusMods,项目名称:NexusModManager-4.5,代码行数:16,代码来源:XmlScriptExecutor.cs
示例6: Create
public Match Create(IEnumerable<User> players, IGameMode mode)
{
long matchID = Interlocked.Increment(ref _matchIDs);
Match match = new Match(players, mode, matchID);
_matches.TryAdd(matchID, match);
return match;
}
开发者ID:pksorensen,项目名称:CycleR,代码行数:9,代码来源:MatchManager.cs
示例7: BasicInstallTask
/// <summary>
/// A simple constructor that initializes the object with the given values.
/// </summary>
/// <param name="p_modMod">The mod being installed.</param>
/// <param name="p_gmdGameMode">The the current game mode.</param>
/// <param name="p_mfiFileInstaller">The file installer to use.</param>
/// <param name="p_pmgPluginManager">The plugin manager.</param>
/// <param name="p_booSkipReadme">Whether to skip the installation of readme files.</param>
/// <param name="p_rolActiveMods">The list of active mods.</param>
public BasicInstallTask(IMod p_modMod, IGameMode p_gmdGameMode, IModFileInstaller p_mfiFileInstaller, IPluginManager p_pmgPluginManager, bool p_booSkipReadme, ReadOnlyObservableList<IMod> p_rolActiveMods)
{
Mod = p_modMod;
GameMode = p_gmdGameMode;
FileInstaller = p_mfiFileInstaller;
PluginManager = p_pmgPluginManager;
SkipReadme = p_booSkipReadme;
ActiveMods = p_rolActiveMods;
}
开发者ID:etinquis,项目名称:nexusmodmanager,代码行数:18,代码来源:BasicInstallTask.cs
示例8: ModInstallerFactory
/// <summary>
/// A simple constructor that initializes the factory with the required dependencies.
/// </summary>
/// <param name="p_gmdGameMode">The game mode for which the created installer will be installing mods.</param>
/// <param name="p_eifEnvironmentInfo">The application's envrionment info.</param>
/// <param name="p_futFileUtility">The file utility class.</param>
/// <param name="p_scxUIContext">The <see cref="SynchronizationContext"/> to use to marshall UI interactions to the UI thread.</param>
/// <param name="p_ilgInstallLog">The install log that tracks mod install info
/// for the current game mode.</param>
/// <param name="p_pmgPluginManager">The plugin manager to use to work with plugins.</param>
public ModInstallerFactory(IGameMode p_gmdGameMode, IEnvironmentInfo p_eifEnvironmentInfo, FileUtil p_futFileUtility, SynchronizationContext p_scxUIContext, IInstallLog p_ilgInstallLog, IPluginManager p_pmgPluginManager, ModManager p_mmModManager)
{
m_gmdGameMode = p_gmdGameMode;
m_eifEnvironmentInfo = p_eifEnvironmentInfo;
m_futFileUtility = p_futFileUtility;
m_scxUIContext = p_scxUIContext;
m_ilgInstallLog = p_ilgInstallLog;
m_pmgPluginManager = p_pmgPluginManager;
m_mmModManager = p_mmModManager;
}
开发者ID:etinquis,项目名称:nexusmodmanager,代码行数:20,代码来源:ModInstallerFactory.cs
示例9: ConsoleMenuHandler
/// <summary>
/// Creates a new console menu handler
/// </summary>
/// <param name="inputProvider">Input provider</param>
/// <param name="renderer">Renderer</param>
/// <param name="menuItems">Menu items</param>
/// <param name="menuTop">Menu rendering top row</param>
/// <param name="menuLeft">Menu rendering left col</param>
public ConsoleMenuHandler(IConsoleInputProvider inputProvider, IConsoleRenderer renderer, IEnumerable<IGameMode> menuItems, int menuTop, int menuLeft)
{
this.inputProvider = inputProvider;
this.renderer = renderer;
this.currentSelection = new BeginnerMode();
this.menuItems = menuItems;
this.menuBodyTop = menuTop + RenderersConstants.MenuTitleRowsCount;
this.menuBodyLeft = menuLeft;
this.selectionCharTop = menuTop + RenderersConstants.MenuTitleRowsCount;
this.selectionCharLeft = this.menuBodyLeft;
}
开发者ID:Minesweeper-1,项目名称:HQC-Team-Minesweeper-1,代码行数:19,代码来源:ConsoleMenuHandler.cs
示例10: SplashMode
public SplashMode(
string imageFilename,
double secondsDisplayed,
IGameMode nextMode)
{
// Save the properties
this.imageFilename = imageFilename;
this.secondsDisplayed = secondsDisplayed;
this.secondsRemaining = secondsDisplayed;
this.nextMode = nextMode;
}
开发者ID:dmoonfire,项目名称:cutegod,代码行数:11,代码来源:SplashMode.cs
示例11: CreateMod
/// <summary>
/// Creates a mod of the appropriate type from the specified file.
/// Code copy&pasted from class ModRegistry
/// </summary>
/// <param name="p_strModPath">The path to the mod file.</param>
/// <returns>A mod of the appropriate type from the specified file, if the type of hte mod
/// can be determined; <c>null</c> otherwise.</returns>
private static IMod CreateMod(string modPath, IModFormatRegistry formatRegistry, IGameMode gameMode)
{
List<KeyValuePair<FormatConfidence, IModFormat>> lstFormats = new List<KeyValuePair<FormatConfidence, IModFormat>>();
foreach (IModFormat mftFormat in formatRegistry.Formats)
lstFormats.Add(new KeyValuePair<FormatConfidence, IModFormat>(mftFormat.CheckFormatCompliance(modPath), mftFormat));
lstFormats.Sort((x, y) => -x.Key.CompareTo(y.Key));
if (lstFormats[0].Key <= FormatConfidence.Convertible)
{
Console.WriteLine("failed to determine format for " + modPath);
return null;
}
return lstFormats[0].Value.CreateMod(modPath, gameMode);
}
开发者ID:TanninOne,项目名称:modorganizer-NCC,代码行数:20,代码来源:Program.cs
示例12: Match
public Match(IEnumerable<User> players, IGameMode mode, long id)
{
_players = new List<User>(players);
_mode = mode;
ID = id;
State = MatchState.Ready;
foreach (User player in _players)
{
player.CurrentMatch = this;
}
_broadcastHandler = new BroadcastHandler(id, players);
_loadingHandler = new MatchLoadingHandler(players, initializeGame);
}
开发者ID:pksorensen,项目名称:CycleR,代码行数:15,代码来源:Match.cs
示例13: TextScrollGameMode
/// <summary>
/// Constructs a text display mode with a given embedded
/// resource.
/// </summary>
public TextScrollGameMode(string path, IGameMode nextMode)
{
// Save the next mode
this.next = nextMode;
// Process the assembly manifest and convert it into the
// scrolling structure with the various line encoding.
Assembly assembly = GetType().Assembly;
using (Stream s = assembly.GetManifestResourceStream(path))
{
// Wrap in a stream reader
StreamReader sr = new StreamReader(s);
// Go through the lines
string line = null;
while ((line = sr.ReadLine()) != null)
{
// Create the line
TextScrollLine tsl = new TextScrollLine();
// Check for header flags
if (line.StartsWith("=1 "))
{
tsl.LineType = LineType.Heading1;
tsl.Line = line.Substring(3);
}
else if (line.StartsWith("=2 "))
{
tsl.LineType = LineType.Heading1;
tsl.Line = line.Substring(3);
}
else if (line.StartsWith("=3 "))
{
tsl.LineType = LineType.Heading3;
tsl.Line = line.Substring(3);
}
else
{
tsl.Line = line;
}
// Add the line
lines.Add(tsl);
}
}
}
开发者ID:dmoonfire,项目名称:running-bomb,代码行数:52,代码来源:TextScrollGameMode.cs
示例14: Game
public Game(IEnumerable<User> players, IGameMode mode, BroadcastHandler broadcastHandler, Action onFinish)
{
_mode = mode;
_gameConfiguration = _mode.GetConfiguration();
_broadcastHandler = broadcastHandler;
_map = new Map(_gameConfiguration.MapConfig);
var cycleDictionary = createCycles(players);
_onFinish = onFinish;
_cycleManager = new CycleManager(cycleDictionary);
_map.RegisterCycles(cycleDictionary);
_broadcastHandler.RegisterCycles(cycleDictionary);
CommandHandler = new CommandHandler(cycleDictionary);
}
开发者ID:pksorensen,项目名称:CycleR,代码行数:17,代码来源:Game.cs
示例15: DummyPluginManager
public DummyPluginManager(string pluginsFile, IGameMode gameMode, IMod mod)
{
StreamReader reader = new StreamReader(pluginsFile);
string installationPath = Path.Combine(gameMode.GameModeEnvironmentInfo.InstallationPath, gameMode.GetModFormatAdjustedPath(mod.Format, null, false));
string line;
while ((line = reader.ReadLine()) != null)
{
if (line[0] != '#')
{
m_Plugins.Add(new Plugin(Path.Combine(installationPath, line.ToLower()), line, null));
}
}
((INotifyCollectionChanged)m_Plugins).CollectionChanged += new NotifyCollectionChangedEventHandler(ActivePlugins_CollectionChanged);
m_ROOLPlugins = new ReadOnlyObservableList<Plugin>(m_Plugins);
}
开发者ID:TanninOne,项目名称:modorganizer-NCC,代码行数:17,代码来源:DummyPluginManager.cs
示例16: DiscoverScriptTypes
/// <summary>
/// Searches for script type assemblies in the specified path, and loads
/// any script types that are found into a registry.
/// </summary>
/// <remarks>
/// A script type is loaded if the class implements <see cref="IScriptType"/> and is
/// not abstract. Once loaded, the type is added to the registry.
/// </remarks>
/// <param name="p_strSearchPath">The path in which to search for script type assemblies.</param>
/// <param name="p_gmdGameMode">The current game mode.</param>
/// <returns>A registry containing all of the discovered script types.</returns>
public static IScriptTypeRegistry DiscoverScriptTypes(string p_strSearchPath, IGameMode p_gmdGameMode)
{
Trace.TraceInformation("Discovering Script Types...");
Trace.Indent();
Trace.TraceInformation("Discovering Generic Script Types...");
Trace.Indent();
Trace.TraceInformation("Looking in: {0}", p_strSearchPath);
IScriptTypeRegistry stgRegistry = new ScriptTypeRegistry();
if (!Directory.Exists(p_strSearchPath))
{
Trace.TraceError("Script Type search path does not exist.");
Trace.Unindent();
Trace.Unindent();
return stgRegistry;
}
string[] strAssemblies = Directory.GetFiles(p_strSearchPath, "*.dll");
RegisterScriptTypes(stgRegistry, strAssemblies);
Trace.Unindent();
Trace.TraceInformation("Discovering Game Mode Specific Script Types...");
Trace.Indent();
string strGameModeSearchPath = Path.GetDirectoryName(Assembly.GetAssembly(p_gmdGameMode.GetType()).Location);
Trace.TraceInformation("Looking in: {0}", strGameModeSearchPath);
if (!Directory.Exists(strGameModeSearchPath))
{
Trace.TraceError("Game Mode Specific Script Type search path does not exist.");
Trace.Unindent();
Trace.Unindent();
return stgRegistry;
}
List<string> lstAssemblies = new List<string>();
foreach (IScriptType stpType in stgRegistry.Types)
lstAssemblies.AddRange(Directory.GetFiles(strGameModeSearchPath, String.Format("{0}.{1}.dll", p_gmdGameMode.ModeId, stpType.TypeId)));
RegisterScriptTypes(stgRegistry, lstAssemblies);
Trace.Unindent();
Trace.Unindent();
return stgRegistry;
}
开发者ID:NexusMods,项目名称:NexusModManager-4.5,代码行数:51,代码来源:ScriptTypeRegistry.cs
示例17: GetScriptFunctionProxy
/// <summary>
/// Returns a proxy that implements the functions available to Mod Script scripts.
/// </summary>
/// <param name="p_modMod">The mod being installed.</param>
/// <param name="p_gmdGameMode">The game mode currently bieng managed.</param>
/// <param name="p_eifEnvironmentInfo">The application's envrionment info.</param>
/// <param name="p_igpInstallers">The utility class to use to install the mod items.</param>
/// <param name="p_scxUIContext">The <see cref="SynchronizationContext"/> to use to marshall UI interactions to the UI thread.</param>
/// <returns>A proxy that implements the functions available to Mod Script scripts.</returns>
protected override ModScriptFunctionProxy GetScriptFunctionProxy(IMod p_modMod, IGameMode p_gmdGameMode, IEnvironmentInfo p_eifEnvironmentInfo, InstallerGroup p_igpInstallers, SynchronizationContext p_scxUIContext)
{
return new WoTModScriptFunctionProxy(p_modMod, p_gmdGameMode, p_eifEnvironmentInfo, p_igpInstallers, new ModScriptUIUtil(p_gmdGameMode, p_eifEnvironmentInfo, p_scxUIContext));
}
开发者ID:NexusMods,项目名称:NexusModManager-4.5,代码行数:13,代码来源:WoTModScriptType.cs
示例18: CreateConditionStateManager
/// <summary>
/// Creates a <see cref="ConditionStateManager"/> to use when running an XML script.
/// </summary>
/// <param name="p_modMod">The mod being installed.</param>
/// <param name="p_gmdGameMode">The game mode currently bieng managed.</param>
/// <param name="p_pmgPluginManager">The plugin manager.</param>
/// <param name="p_eifEnvironmentInfo">The application's envrionment info.</param>
/// <returns>A <see cref="ConditionStateManager"/> to use when running an XML script.</returns>
public override ConditionStateManager CreateConditionStateManager(IMod p_modMod, IGameMode p_gmdGameMode, IPluginManager p_pmgPluginManager, IEnvironmentInfo p_eifEnvironmentInfo)
{
return new SkyrimConditionStateManager(p_modMod, p_gmdGameMode, p_pmgPluginManager, p_eifEnvironmentInfo);
}
开发者ID:NexusMods,项目名称:NexusModManager-4.5,代码行数:12,代码来源:SkyrimXmlScriptType.cs
示例19: GetScriptFunctionProxy
/// <summary>
/// Returns a proxy that implements the functions available to C# scripts.
/// </summary>
/// <param name="p_modMod">The mod being installed.</param>
/// <param name="p_gmdGameMode">The game mode currently bieng managed.</param>
/// <param name="p_eifEnvironmentInfo">The application's envrionment info.</param>
/// <param name="p_igpInstallers">The utility class to use to install the mod items.</param>
/// <param name="p_scxUIContext">The <see cref="SynchronizationContext"/> to use to marshall UI interactions to the UI thread.</param>
/// <returns>A proxy that implements the functions available to C# scripts.</returns>
protected override CSharpScriptFunctionProxy GetScriptFunctionProxy(IMod p_modMod, IGameMode p_gmdGameMode, IEnvironmentInfo p_eifEnvironmentInfo, InstallerGroup p_igpInstallers, SynchronizationContext p_scxUIContext)
{
BsaManager bmgBsaManager = new BsaManager((SkyrimGameMode)p_gmdGameMode);
UIUtil uitUiUtilities = new UIUtil(p_gmdGameMode, p_eifEnvironmentInfo, p_scxUIContext);
return new SkyrimCSharpScriptFunctionProxy(p_modMod, p_gmdGameMode, p_eifEnvironmentInfo, p_igpInstallers, bmgBsaManager, uitUiUtilities);
}
开发者ID:etinquis,项目名称:nexusmodmanager,代码行数:15,代码来源:SkyrimCSharpScriptType.cs
示例20: ScriptFunctionProxy
/// <summary>
/// A simple constructor that initializes the object with the given values.
/// </summary>
/// <param name="p_modMod">The mod for which the script is running.</param>
/// <param name="p_gmdGameMode">The game mode currently being managed.</param>
/// <param name="p_eifEnvironmentInfo">The application's envrionment info.</param>
/// <param name="p_igpInstallers">The utility class to use to install the mod items.</param>
/// <param name="p_uipUIProxy">The UI manager to use to interact with UI elements.</param>
public ScriptFunctionProxy(IMod p_modMod, IGameMode p_gmdGameMode, IEnvironmentInfo p_eifEnvironmentInfo, InstallerGroup p_igpInstallers, UIUtil p_uipUIProxy)
{
Mod = p_modMod;
GameMode = p_gmdGameMode;
EnvironmentInfo = p_eifEnvironmentInfo;
Installers = p_igpInstallers;
UIManager = p_uipUIProxy;
}
开发者ID:etinquis,项目名称:nexusmodmanager,代码行数:16,代码来源:ScriptFunctionProxy.cs
注:本文中的IGameMode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论