本文整理汇总了C#中Mod类的典型用法代码示例。如果您正苦于以下问题:C# Mod类的具体用法?C# Mod怎么用?C# Mod使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Mod类属于命名空间,在下文中一共展示了Mod类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: ExecuteTest3
public void ExecuteTest3()
{
var exp = new Mod(new Number(0), new Number(5));
var result = exp.Execute();
Assert.Equal(0.0, result);
}
示例3: ExecuteTest4
public void ExecuteTest4()
{
var exp = new Mod(new Number(5), new Number(0));
var result = exp.Execute();
Assert.Equal(double.NaN, result);
}
示例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;
}
示例5: ExecuteTest1
public void ExecuteTest1()
{
var exp = new Mod(new Number(25), new Number(7));
var result = exp.Execute();
Assert.Equal(4.0, result);
}
示例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();
}
示例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);
}
示例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);
}
}
示例9: AddIngredient
public void AddIngredient(Mod mod, string itemName, int stack = 1)
{
if(mod == null)
{
mod = this.mod;
}
this.AddIngredient(mod.ItemType(itemName), stack);
}
示例10: AddCraftGroup
public void AddCraftGroup(Mod mod, string name, int stack = 1)
{
if (mod == null)
{
mod = this.mod;
}
this.AddCraftGroup(mod.GetCraftGroup(name), stack);
}
示例11: SetResult
public void SetResult(Mod mod, string itemName, int stack = 1)
{
if(mod == null)
{
mod = this.mod;
}
this.SetResult(mod.ItemType(itemName), stack);
}
示例12: LoadMod
public IEnumerable<ActivityItem> LoadMod(Mod mod)
{
foreach (var item in loadMod(mod.FullFolderPath))
{
item.Mod = mod;
yield return item;
}
}
示例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(' ', '_');
}
示例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);
}
示例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();
}