本文整理汇总了C#中Terraria.Main类的典型用法代码示例。如果您正苦于以下问题:C# Main类的具体用法?C# Main怎么用?C# Main使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Main类属于Terraria命名空间,在下文中一共展示了Main类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MB
public MB(Main game)
: base(game)
{
Order = 1;
config = new MBConfig();
}
示例2: AFK
public AFK(Main game)
: base(game)
{
Order = 50;
AFKConfig = new AFKConfigFile();
Players = new Player[256];
}
示例3: AddMenuButtons
//add to Terraria.Main.DrawMenu in Main.menuMode == 0 after achievements
//Interface.AddMenuButtons(this, this.selectedMenu, array9, array7, ref num, ref num3, ref num10, ref num5);
internal static void AddMenuButtons(Main main, int selectedMenu, string[] buttonNames, float[] buttonScales, ref int offY, ref int spacing, ref int buttonIndex, ref int numButtons)
{
buttonNames[buttonIndex] = "Mods";
if (selectedMenu == buttonIndex)
{
Main.PlaySound(10, -1, -1, 1);
Main.menuMode = modsMenuID;
}
buttonIndex++;
numButtons++;
buttonNames[buttonIndex] = "Mod Sources";
if (selectedMenu == buttonIndex)
{
Main.PlaySound(10, -1, -1, 1);
Main.menuMode = modSourcesID;
}
buttonIndex++;
numButtons++;
buttonNames[buttonIndex] = "Mod Browser (Beta)";
if (selectedMenu == buttonIndex)
{
Main.PlaySound(10, -1, -1, 1);
Main.menuMode = modBrowserID;
}
buttonIndex++;
numButtons++;
offY = 220;
for (int k = 0; k < numButtons; k++)
{
buttonScales[k] = 0.82f;
}
spacing = 45;
}
示例4: TChatChannels
public TChatChannels(Main game)
: base(game)
{
AutoJoin = true;
PlugInHandler.AddPlugIn(this);
Manager = new ChannelManager();
}
示例5: TradeRequest
public TradeRequest(Main game) : base(game)
{
Order = 4;
for (int i = 0; i < Main.maxPlayers; i++)
TradeActive[i] = new TradePlayer();
}
示例6: LaunchGame
public static void LaunchGame(string[] args)
{
Program.LaunchParameters = Utils.ParseArguements(args);
ThreadPool.SetMinThreads(8, 8);
using (Main main = new Main())
{
try
{
SocialAPI.Initialize(null);
LaunchInitializer.LoadParameters(main);
Main.OnEngineLoad += delegate
{
Program.ForceLoadAssembly(Assembly.GetExecutingAssembly(), true);
};
#if CLIENT
main.Run();
#else
main.DedServ();
#endif
}
catch (Exception e)
{
Program.DisplayException(e);
}
}
}
示例7: Cauldron
public Cauldron(Main game)
: base(game)
{
Order = 4;
String savepath = Path.Combine(TShock.SavePath, "potions.cfg");
CauldronReader reader = new CauldronReader();
if (File.Exists(savepath))
{
try
{
potions = reader.readFile(savepath);
Console.WriteLine(potions.potions.Count + " potions have been loaded.");
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
else
{
potions = reader.writeFile(savepath);
Console.WriteLine("Basic potion file being created.");
Console.WriteLine("1 potion containing regeneration for 30 seconds created.");
Console.WriteLine("1 potion containing swiftness for 30 seconds created.");
}
}
示例8: ItemDropLogPlugin
public ItemDropLogPlugin(Main game) : base(game)
{
this._dropLocker = new object();
this._drops = new ItemDrop[Main.item.Length];
this._playerDropsPending = new List<ItemDrop>(Main.item.Length);
this._ignoredItems = new List<Item>();
}
示例9: TeamSpawn
public TeamSpawn(Main game)
: base(game)
{
config = Config.Read(savepath);
config.Write(savepath);
deadplayers = new Dictionary<int,int>(255);
}
示例10: InfiniteSigns
public InfiniteSigns(Main game)
: base(game)
{
for (int i = 0; i < 256; i++)
Infos[i] = new PlayerInfo() { Index = i };
Order = 1;
}
示例11: PluginMain
public PluginMain( Main game )
: base(game)
{
Order = 1;
Plrs = new List<Buffee>();
GloballyBanned = new List<int>();
}
示例12: MAC
public MAC(Main game)
: base(game)
{
Order = -1;
config = new MACconfig();
}
示例13: InnerStart
private static void InnerStart(string[] args)
{
try
{
Program.LaunchParameters = Utils.ParseArguements(args);
ProgramServer.Game = new Main();
string str = null;
if (str != null)
{
ProgramServer.Game.SetWorld(str);
}
try
{
Console.WriteLine("TerrariaAPI Version: " + ServerApi.ApiVersion + " (Protocol {0} ({1}))", Terraria.Main.versionNumber2, Terraria.Main.curRelease);
Console.WriteLine("SendQ edition");
ServerApi.Initialize(args, Game);
}
catch (Exception ex)
{
ServerApi.LogWriter.ServerWriteLine(
"Startup aborted due to an exception in the Server API initialization:\n" + ex, TraceLevel.Error);
Console.ReadLine();
return;
}
ProgramServer.Game.DedServ();
ServerApi.DeInitialize();
}
catch (Exception exception1)
{
ServerApi.LogWriter.ServerWriteLine("Server crashed due to an unhandled exception:\n" + exception1, TraceLevel.Error);
}
}
示例14: SignCommands
public SignCommands(Main game)
: base(game)
{
getConfig = new scConfig();
Order = 4;
}
示例15: Jail
public Jail(Main game)
: base(game)
{
Order = 3;
JPConfig = new JPConfigFile();
Players = new Player[256];
}