• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Terraria.Main类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Terraria.Main的典型用法代码示例。如果您正苦于以下问题:C# Main类的具体用法?C# Main怎么用?C# Main使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Main类属于Terraria命名空间,在下文中一共展示了Main类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: MB

        public MB(Main game)
            : base(game)
        {
            Order = 1;

            config = new MBConfig();
        }
开发者ID:Tygra,项目名称:MultiBuff,代码行数:7,代码来源:MB.cs


示例2: AFK

 public AFK(Main game)
     : base(game)
 {
     Order = 50;
     AFKConfig = new AFKConfigFile();
     Players = new Player[256];
 }
开发者ID:CrazyLegsSteph,项目名称:AFK,代码行数:7,代码来源:AFK.cs


示例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;
		}
开发者ID:JavidPack,项目名称:TerraCustom,代码行数:35,代码来源:Interface.cs


示例4: TChatChannels

 public TChatChannels(Main game)
     : base(game)
 {
     AutoJoin = true;
     PlugInHandler.AddPlugIn(this);
     Manager = new ChannelManager();
 }
开发者ID:jordsti,项目名称:TPulse,代码行数:7,代码来源:TChatChannels.cs


示例5: TradeRequest

        public TradeRequest(Main game) : base(game)
        {
            Order = 4;

            for (int i = 0; i < Main.maxPlayers; i++)
                TradeActive[i] = new TradePlayer();
        }
开发者ID:Marcus101RR,项目名称:TradeRequest,代码行数:7,代码来源:TradeRequest.cs


示例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);
				}
			}
		}
开发者ID:thegamingboffin,项目名称:Ulterraria_Reborn_GitHub,代码行数:26,代码来源:Program.cs


示例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.");
     }
 }
开发者ID:Olink,项目名称:Cauldron,代码行数:26,代码来源:Cauldron.cs


示例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>();
		}
开发者ID:Tygra,项目名称:ItemDroplog,代码行数:7,代码来源:ItemDropLogPlugin.cs


示例9: TeamSpawn

 public TeamSpawn(Main game)
     : base(game)
 {
     config = Config.Read(savepath);
     config.Write(savepath);
     deadplayers = new Dictionary<int,int>(255);
 }
开发者ID:Olink,项目名称:TeamSpawn,代码行数:7,代码来源:TeamSpawn.cs


示例10: InfiniteSigns

 public InfiniteSigns(Main game)
     : base(game)
 {
     for (int i = 0; i < 256; i++)
         Infos[i] = new PlayerInfo() { Index = i };
     Order = 1;
 }
开发者ID:MarioE,项目名称:InfiniteSigns,代码行数:7,代码来源:InfiniteSigns.cs


示例11: PluginMain

 public PluginMain( Main game )
     : base(game)
 {
     Order = 1;
     Plrs = new List<Buffee>();
     GloballyBanned = new List<int>();
 }
开发者ID:SnirkImmington,项目名称:RegionBuffs,代码行数:7,代码来源:PluginMain.cs


示例12: MAC

        public MAC(Main game)
            : base(game)
        {
            Order = -1;

            config = new MACconfig();
        }
开发者ID:Zaicon,项目名称:MoreAdminCommandsV3,代码行数:7,代码来源:MoreAdminCommands.cs


示例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);
            }
        }
开发者ID:hastinbe,项目名称:TerrariaAPI-Server,代码行数:33,代码来源:ProgramServer.cs


示例14: SignCommands

        public SignCommands(Main game)
            : base(game)
        {
            getConfig = new scConfig();

            Order = 4;
        }
开发者ID:SnirkImmington,项目名称:Essentials-SignCommands,代码行数:7,代码来源:scMain.cs


示例15: Jail

 public Jail(Main game)
     : base(game)
 {
     Order = 3;
     JPConfig = new JPConfigFile();
     Players = new Player[256];
 }
开发者ID:Kampfschaf,项目名称:TSHOCK-Jail---Prison-Plugin,代码行数:7,代码来源:Jail.cs


示例16: BH

        public BH(Main game)
            : base(game)
        {
            Order = -1;

            config = new BHConfig();
        }
开发者ID:bippity,项目名称:BountyHunt,代码行数:7,代码来源:BH.cs


示例17: CustomJoin

 public CustomJoin(Main game)
     : base(game)
 {
     Order = -10;
     cfg = new cjConfig();
     LastJoinIndex = -1;
 }
开发者ID:UB1AFU,项目名称:CustomJoin,代码行数:7,代码来源:CustomJoin.cs


示例18: Initialize

 public static void Initialize(Main main)
 {
     if (!Directory.Exists("ServerPlugins"))
     {
         Directory.CreateDirectory("ServerPlugins");
     }
     AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(Program.CurrentDomain_AssemblyResolve);
     FileInfo[] files = new DirectoryInfo("ServerPlugins").GetFiles("*.dll");
     for (int i = 0; i < files.Length; i++)
     {
         FileInfo fileInfo = files[i];
         try
         {
             string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileInfo.Name);
             Assembly assembly;
             if (!Program.LoadedAssemblies.TryGetValue(fileNameWithoutExtension, out assembly))
             {
                 assembly = Assembly.Load(File.ReadAllBytes(fileInfo.FullName));
                 Program.LoadedAssemblies.Add(fileNameWithoutExtension, assembly);
             }
             Type[] types = assembly.GetTypes();
             for (int j = 0; j < types.Length; j++)
             {
                 Type type = types[j];
                 if (type.BaseType == typeof(TerrariaPlugin))
                 {
                     if (Program.Compatible(type))
                     {
                         Program.Plugins.Add(new PluginContainer((TerrariaPlugin)Activator.CreateInstance(type, new object[]
                         {
                             main
                         })));
                     }
                     else
                     {
                         Console.WriteLine("Outdated plugin: {0} ({1})", fileInfo.Name, type);
                     }
                 }
             }
         }
         catch (Exception innerException)
         {
             if (innerException is TargetInvocationException)
             {
                 innerException = ((TargetInvocationException)innerException).InnerException;
             }
             Console.WriteLine("Plugin {0} failed to load", fileInfo.Name);
         }
     }
     IOrderedEnumerable<PluginContainer> orderedEnumerable =
         from x in Program.Plugins
         orderby x.Plugin.Order, x.Plugin.Name
         select x;
     foreach (PluginContainer current in orderedEnumerable)
     {
         current.Initialize();
         Console.WriteLine("{0} v{1} ({2}) initiated.", current.Plugin.Name, current.Plugin.Version, current.Plugin.Author);
     }
 }
开发者ID:DaGamesta,项目名称:TerrariaAPI-Server,代码行数:59,代码来源:Program.cs


示例19: Maincs

        public Maincs(Main game)
            : base(game)
        {
            Order = 100;

            config = new Config();
            rConfig = new rConfig();
        }
开发者ID:CrazyLegsSteph,项目名称:PvPCommandBlock,代码行数:8,代码来源:Main.cs


示例20: CommandRecipes

        public CommandRecipes(Main game)
            : base(game)
        {
            Order = -10;

              config = new RecConfig();
              Log = new RecipeLog();
        }
开发者ID:Stealownz,项目名称:CommandRecipes,代码行数:8,代码来源:CommandRecipes.cs



注:本文中的Terraria.Main类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Terraria.NPC类代码示例发布时间:2022-05-26
下一篇:
C# Terraria.Item类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap