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

C# Mod类代码示例

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

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



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

示例1: NewDust

 public static int NewDust(Vector2 Position, int Width, int Height, Mod mod, string name, float SpeedX = 0f, float SpeedY = 0f, int Alpha = 0, Color newColor = default(Color), float Scale = 1f)
 {
     int dust = Dust.NewDust(Position, Width, Height, 0, SpeedX, SpeedY, Alpha, newColor, Scale);
     Main.dust[dust].modDust = mod.dusts[name];
     mod.dusts[name].OnSpawn(Main.dust[dust]);
     return dust;
 }
开发者ID:Exeton,项目名称:tModLoader,代码行数:7,代码来源:ModDust.cs


示例2: ExecuteTest3

        public void ExecuteTest3()
        {
            var exp = new Mod(new Number(0), new Number(5));
            var result = exp.Execute();

            Assert.Equal(0.0, result);
        }
开发者ID:sys27,项目名称:xFunc,代码行数:7,代码来源:ModTest.cs


示例3: ExecuteTest4

        public void ExecuteTest4()
        {
            var exp = new Mod(new Number(5), new Number(0));
            var result = exp.Execute();

            Assert.Equal(double.NaN, result);
        }
开发者ID:sys27,项目名称:xFunc,代码行数:7,代码来源:ModTest.cs


示例4: DesignTimeModLibraryViewModel

        public DesignTimeModLibraryViewModel() {
            var game = new Arma1Game(Guid.NewGuid(), new GameSettingsController());
            var collectionGroup = new ModLibraryGroupViewModel(this, "Collections",
                icon: SixIconFont.withSIX_icon_Folder);
            var collections =
                new CustomCollectionLibraryItemViewModel(this,
                    new CustomCollection(Guid.NewGuid(), game) {Name = "Test ModSet"},
                    collectionGroup);
            var subscribedCollections =
                new SubscribedCollectionLibraryItemViewModel(this,
                    new SubscribedCollection(Guid.NewGuid(), Guid.NewGuid(), game) {Name = "Test ModSet3"},
                    collectionGroup);
            var mod = new Mod(Guid.Empty) {
                Name = "@TESTMOD",
                FullName = "Da Full name fewafefiejaofijeafoijeafo ieafioj eaoi",
                Author = "The Author",
                Version = "1.2.0"
            };
            collections.Items.Add(new CustomCollection(Guid.NewGuid(), game) {
                Name = "Some ModSet wuith faopek faof aepokf poaefpokpof  eaf",
                Author = "Some author",
                Version = "1.0.2"
            });
            collections.Items.Add(mod);
            collections.SelectedItem = mod;

            // TODO
            //CreateItemsView(
            //    new ReactiveList<ContentLibraryItem>(new[]
            //    {subscribedCollections, sharedCollections, localCollections}), new LibraryGroup[0]);
            SelectedItem = collections;
        }
开发者ID:MaHuJa,项目名称:withSIX.Desktop,代码行数:32,代码来源:DesignTimeModLibraryViewModel.cs


示例5: ExecuteTest1

        public void ExecuteTest1()
        {
            var exp = new Mod(new Number(25), new Number(7));
            var result = exp.Execute();

            Assert.Equal(4.0, result);
        }
开发者ID:sys27,项目名称:xFunc,代码行数:7,代码来源:ModTest.cs


示例6: CreateModFile

		public static void CreateModFile( string ckDir, Mod mod )
		{
			FileInfo mpath = new FileInfo( ckDir + @"/mod/" + mod.ModFile );
			StreamWriter mw = new StreamWriter( mpath.Open( FileMode.Create, FileAccess.Write ), Encoding.GetEncoding( 1252 ) );

			mw.WriteLine( "name = \"" + mod.Name + "\"" );

			mw.WriteLine( "path = \"" + mod.Path + "\"" );

			mw.WriteLine();

			foreach( string e in mod.Extends )
				mw.WriteLine( "extend = \"" + e + "\"" );

			foreach( string e in mod.Replaces )
				mw.WriteLine( "replace_path = \"" + e + "\"" );

			if( mod.Dependencies.Count >= 0 )
			{
				mw.Write( "dependencies = {" );
				foreach( string s in mod.Dependencies )
					mw.Write( "\"" + s + "\" " );
				mw.WriteLine( "}" );
			}

			mw.Dispose();
		}
开发者ID:Measter,项目名称:TitleGenerator,代码行数:27,代码来源:MiscClasses.cs


示例7: IsPreinstalledMod

        /// <summary>Returns true if the mod is classified as a "preinstalled mod".</summary>
        public static bool IsPreinstalledMod(Mod mod)
        {
            var folderName = mod.Folder;

            return PreinstalledModsList.Contains(folderName) ||
                   OtherClassifiedAsPreinstalled.Contains(folderName);
        }
开发者ID:SneakyMax,项目名称:Cortex-Command-Mod-Manager,代码行数:8,代码来源:PreinstalledMods.cs


示例8: LoadModJSON

            private static void LoadModJSON(string[] modDirectories)
            {
                foreach (string modName in modDirectories)
                {
                    if (new DirectoryInfo(modName).Name == "Localization")
                    {
                        continue;
                    }
                    Mod m = new Mod(new DirectoryInfo(modName).Name);
                    string jsonFilename = modName + "/modinfo.json";
                    string rawJSON = JSONSystem.JSON.GetRawJSONFromFile(jsonFilename);
                    JSONNode output = JSONSystem.JSON.Parse(rawJSON);

                    JSONArray scripts = output["scripts"].AsArray;
                    foreach (JSONNode node in scripts)
                    {
                        m.AddScript(node);
                    }

                    JSONArray sprites = output["sprites"].AsArray;
                    foreach (JSONNode node in sprites)
                    {
                        m.AddSprite(node);
                    }
                    LoadGameModJSON(output, m);
                    AddMod(m);
                }
            }
开发者ID:Jay2645,项目名称:UnityHelperFunctions,代码行数:28,代码来源:ModLoaderBase.cs


示例9: AddIngredient

 public void AddIngredient(Mod mod, string itemName, int stack = 1)
 {
     if(mod == null)
     {
     mod = this.mod;
     }
     this.AddIngredient(mod.ItemType(itemName), stack);
 }
开发者ID:Exeton,项目名称:tModLoader,代码行数:8,代码来源:ModRecipe.cs


示例10: AddCraftGroup

 public void AddCraftGroup(Mod mod, string name, int stack = 1)
 {
     if (mod == null)
     {
         mod = this.mod;
     }
     this.AddCraftGroup(mod.GetCraftGroup(name), stack);
 }
开发者ID:guyde2011,项目名称:tModLoader,代码行数:8,代码来源:ModRecipe.cs


示例11: SetResult

 public void SetResult(Mod mod, string itemName, int stack = 1)
 {
     if(mod == null)
     {
         mod = this.mod;
     }
     this.SetResult(mod.ItemType(itemName), stack);
 }
开发者ID:MESSpace,项目名称:tModLoader,代码行数:8,代码来源:ModRecipe.cs


示例12: LoadMod

 public IEnumerable<ActivityItem> LoadMod(Mod mod)
 {
     foreach (var item in loadMod(mod.FullFolderPath))
     {
         item.Mod = mod;
         yield return item;
     }
 }
开发者ID:SneakyMax,项目名称:Cortex-Command-Mod-Manager,代码行数:8,代码来源:ModActivityItemsLoader.cs


示例13: ModHotkey

		internal string defaultKey; // from mod.Load
		//string configurationString; // Prevent 2 mods from having same hotkey

		public ModHotkey(string name, Mod mod, string defaultKey)
		{
			this.name = name;
			this.mod = mod;
			//this.currentKey = currentKey;
			this.defaultKey = defaultKey;
			this.displayName = mod.Name + ": " + name;
			//configurationString = mod.Name + "_" + "HotKey" + "_" + name.Replace(' ', '_');
		}
开发者ID:JavidPack,项目名称:TerraCustom,代码行数:12,代码来源:ModHotkey.cs


示例14: DesignTimeLicenseDialogViewModel

 public DesignTimeLicenseDialogViewModel() {
     var msLicense = new ModSetLicenses("Test Mod") {IsModSetLicensesExpanded = true};
     ModSetLicenses = new List<ModSetLicenses> {msLicense};
     var mod = new Mod(Guid.NewGuid()) {Name = "Test Mod", ModVersion = "1.0.0"};
     var ml = new ModLicense(null, String.Format("{0} {1}", mod.Name, mod.ModVersion)) {
         IsModLicenseExpanded = true
     };
     msLicense.ModLicenses.Add(ml);
 }
开发者ID:MaHuJa,项目名称:withSIX.Desktop,代码行数:9,代码来源:DesignTimeLicenseDialogViewModel.cs


示例15: BlockInfo

 public BlockInfo(DataTable dataTable, String name, ModList modList, Mod curMod)
 {
     data = dataTable;
     this.modList = modList;
     this.curMod = curMod;
     this.name = name;
     InitializeComponent();
     loadData();
 }
开发者ID:tboby,项目名称:BRModTools,代码行数:9,代码来源:BlockInfo.cs


示例16: GetModPlayer

		internal static ModPlayer GetModPlayer(Player player, Mod mod, string name)
		{
			IDictionary<string, int> modIndexes = indexes[mod.Name];
			if (!modIndexes.ContainsKey(name))
			{
				return null;
			}
			return player.modPlayers[modIndexes[name]];
		}
开发者ID:DrakoGlyph,项目名称:tModLoader,代码行数:9,代码来源:PlayerHooks.cs


示例17: ModButtonViewModel

    public ModButtonViewModel(Mod.Header.Button button)
    {
        this.button = button;
        AssignedKey = Configuration.GetString("Mods." + button.Mod.Game.GameConfiguration.ID + "." + button.Mod.ID + ".Buttons." + button.ID);
        if (AssignedKey == "")
        {
            Key = button.StandardKey;

        }
    }
开发者ID:hamada147,项目名称:ModAPI,代码行数:10,代码来源:ModButtonViewModel.cs


示例18: ModViewModel

        /// <summary>Creates a new view model wrapper for a mod.</summary>
        public ModViewModel(Mod mod, ModManager modManager, PresetManager presetManager)
            : base()
        {
            this.modManager = modManager;
            this.presetManager = presetManager;

            Mod = mod;

            DeleteModCommand = new Command(DeleteMod);
            AddModToPresetCommand = new Command<Preset>(AddToPreset);
            NewPresetForModCommand = new Command(AddToNewPreset);
        }
开发者ID:SneakyMax,项目名称:Cortex-Command-Mod-Manager,代码行数:13,代码来源:ModViewModel.cs


示例19: CheckItems

 public static void CheckItems(Mod mod, Player player, ref int damage, ref float knockBack)
 {
     // Loop throught the accessories of the player.
     for (int i = 3; i < 8 + player.extraAccessorySlots; i++)
     {
         // -50% knockback.
         if (player.armor[i].type == mod.ItemType("TornadoAnklet") || player.armor[i].type == mod.ItemType("HeavyRing"))
             knockBack /= 2;
         else if (player.armor[i].type == mod.ItemType("ReinforcedRing"))
             knockBack -= (knockBack / 5); // 20% less knockback
     }
 }
开发者ID:Eldrazi,项目名称:Pletharia,代码行数:12,代码来源:GlobalFunctionality.cs


示例20: ModIsInAPreset

 public bool ModIsInAPreset(Mod mod)
 {
     if (presetModsBuffer == null)
     {
         LoadModsBuffer();
     }
     if (presetModsBuffer.Contains(mod.Folder))
     {
         return true;
     }
     return false;
 }
开发者ID:SneakyMax,项目名称:Cortex-Command-Mod-Manager,代码行数:12,代码来源:PresetManager.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# ModData类代码示例发布时间:2022-05-24
下一篇:
C# Mocks类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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