本文整理汇总了C#中IGameMode类的典型用法代码示例。如果您正苦于以下问题:C# IGameMode类的具体用法?C# IGameMode怎么用?C# IGameMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IGameMode类属于命名空间,在下文中一共展示了IGameMode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
}
}
示例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);
}
示例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);
}