本文整理汇总了C#中Level类的典型用法代码示例。如果您正苦于以下问题:C# Level类的具体用法?C# Level怎么用?C# Level使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Level类属于命名空间,在下文中一共展示了Level类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: log
private void log(string message, Level currentLevel)
{
if (LevelComparator.pass(currentLevel, logLevel))
{
parentNode.forward(_name, currentLevel, message);
}
}
开发者ID:kevoree,项目名称:kevoree-dotnet-log,代码行数:7,代码来源:Logger.cs
示例2: LogTo
public static void LogTo(Level level, Boolean fireEvent, String rawMessage)
{
String message = Regex.Replace(rawMessage, "cardno=[^&]*", "****************");
switch (level)
{
case Level.INFO:
NLogger.Info(message);
break;
case Level.TRACE:
NLogger.Trace(message);
break;
case Level.DEBUG:
NLogger.Debug(message);
break;
case Level.WARNING:
NLogger.Warn(message);
break;
case Level.ERROR:
NLogger.Error(message);
break;
case Level.FATAL:
NLogger.Fatal(message);
break;
}
if (fireEvent)
{
InvokeLogToGui(new GuiEventArgs(level, message));
}
}
开发者ID:alexkasp,项目名称:monitor,代码行数:31,代码来源:Logger.cs
示例3: Log
public static void Log(Level level, String message)
{
Config cfg = Config.Load();
if (cfg.LogVerbosity <= level)
{
string line = String.Format("{0} [{1}] - {2}", DateTime.Now, level, message);
if ((cfg.LogOutput & Outputs.Console) == Outputs.Console)
{
if (level <= Level.Info)
{
Console.WriteLine(line);
} else
{
Console.Error.WriteLine(line);
}
}
if ((cfg.LogOutput & Outputs.File) == Outputs.File)
{
Stream.WriteLine(line);
Stream.Flush();
}
}
}
开发者ID:TilmannBach,项目名称:cloudmusic2upnp,代码行数:26,代码来源:Logger.cs
示例4: interact
public override bool interact(Level level, int xt, int yt, Player player, Item item, int attackDir)
{
if (item is ToolItem)
{
ToolItem tool = (ToolItem)item;
if (tool.type == ToolType.shovel)
{
if (player.payStamina(4 - tool.level))
{
level.setTile(xt, yt, Tile.hole, 0);
level.add(new ItemEntity(new ResourceItem(Resource.dirt), xt * 16 + random.nextInt(10) + 3, yt * 16 + random.nextInt(10) + 3));
Sound.monsterHurt.play();
return true;
}
}
if (tool.type == ToolType.hoe)
{
if (player.payStamina(4 - tool.level))
{
level.setTile(xt, yt, Tile.farmland, 0);
Sound.monsterHurt.play();
return true;
}
}
}
return false;
}
开发者ID:xposure,项目名称:MiniCraft.NET,代码行数:27,代码来源:DirtTile.cs
示例5: UnityLog
public static void UnityLog(int i, Level level = Level.DEBUG)
{
string s = i.ToString();
switch (level) {
case Level.DEBUG:
s = "[DEBUG]" + s;
Debug.Log(s);
break;
case Level.INFO:
s = "[INFO]" + s;
Debug.Log(s);
break;
case Level.WARNING:
s = "[WARNING]" + s;
Debug.LogWarning(s);
break;
case Level.ERROR:
Debug.LogError(s);
s = "[ERROR]" + s;
break;
default:
s = "[DEFAULT]" + s;
UnityLog("I was given a log level that doesn't exist.", Level.WARNING);
break;
}
}
开发者ID:SacredSkull,项目名称:nightfall-incident-port,代码行数:26,代码来源:Misc.cs
示例6: PanTool
public PanTool(Level pointer, Tool prevTool, Point startPoint)
: base(pointer)
{
this.pointer = pointer;
this.prevTool = prevTool;
this.startPoint = startPoint;
}
开发者ID:gamemaker19,项目名称:StickShooterLevelEditor,代码行数:7,代码来源:PanTool.cs
示例7: SaveToFile
public static void SaveToFile(Level data, string fileName)
{
IFormatter formatter = new BinaryFormatter();
Stream stream = new FileStream(string.Format("{0}.level", fileName), FileMode.Create, FileAccess.Write, FileShare.Write);
formatter.Serialize(stream, data);
stream.Close();
}
开发者ID:alexkirwan29,项目名称:Cubes-Of-Wrath,代码行数:7,代码来源:LevelIO.cs
示例8: IsEnabledFor
/// <summary>
/// 获取指定级别的日志是否可记录。
/// </summary>
/// <param name="level">级别</param>
/// <returns>是否可记录</returns>
public bool IsEnabledFor(Level level)
{
var cacheValue = this.Cache.Get<string>(Constants.LogerLevelCacheKey);
if (string.IsNullOrWhiteSpace(cacheValue))
{
try
{
cacheValue = this.SqlMapperManager[RW.Read].QueryForObject<string>(string.Format(StatementFormatter, this.SqlMapNamespace, "GetLoggerLevel"), null);
if (string.IsNullOrWhiteSpace(cacheValue))
{
cacheValue = "1";
}
else
{
this.Cache.Add(Constants.LogerLevelCacheKey, cacheValue);
}
}
catch
{
cacheValue = "1";
}
}
var iLevel = int.Parse(cacheValue);
var minLevel = (Level)iLevel;
return level >= minLevel;
}
开发者ID:fenglinz,项目名称:Sparrow,代码行数:36,代码来源:Logger.cs
示例9: Get
public static LevelClearState? Get(WorldType world, Level level)
{
var key = MakeKey(world, level);
if (!PlayerPrefs.HasKey(key))
return null;
return (LevelClearState)Enum.Parse(typeof (LevelClearState), PlayerPrefs.GetString(key));
}
开发者ID:SNUGDC,项目名称:snugdc-study-bouncy_ball,代码行数:7,代码来源:UserLevelClear.cs
示例10: EasyTraceEvent
// EasyTraceEvent
// Checks the keyword and level before emiting the event
static internal void EasyTraceEvent(Keyword keywords, Level level, Event eventID)
{
if (IsEnabled(keywords, level))
{
EventProvider.TraceEvent(eventID, keywords, level);
}
}
开发者ID:JianwenSun,项目名称:cc,代码行数:9,代码来源:Trace.cs
示例11: LevelManager
/// <summary>
/// Constructor for testing purposes
/// </summary>
/// <param name="game"></param>
/// <param name="testConstructor"></param>
public LevelManager(Game game, bool testConstructor)
: base(game)
{
//updateCam = false;
//curLevelInfo = 0;
//levels = new List<LevelInfo>();
//currentLevel = new Level();
////levels.Add(new LevelInfo("", 3, 72, 8, 1, 200, 0, 25, Constants.RED_PLATFORM));
////generator = new LevelGenerator(currentLevel, levels, 42, new ChunkType[,] { {ChunkType.FLOOR}, {ChunkType.STAIRS}, {ChunkType.FLOATING_PLATFORMS_SAFE},
//// {ChunkType.FLOATING_PLATFORMS_NOT_SAFE}, {ChunkType.MOUNTAIN_LEFT}, {ChunkType.MOUNTAIN_RIGHT}, {ChunkType.JAGGIES_LEFT}, {ChunkType.JAGGIES_RIGHT},
//// {ChunkType.TALL_GROUND}});
//levels.Add(new LevelInfo("", 3, 8, 8, 0, 200, 0, 0, Constants.RED_PLATFORM));
//generator = new LevelGenerator(currentLevel, levels, 42, new ChunkType[,] { {ChunkType.TALL_GROUND}});
//currentLevel = generator.GenerateNewLevel(0, 1);
//this.SetUpCameraDefault();
//this.projectiles = new List<Projectile>();
//this.expOrbs = new List<ExperienceOrb>();
updateCam = false;
curLevelInfo = 0;
setUpLevels();
currentLevel = new Level(levels[curLevelInfo].width, levels[curLevelInfo].height, 1);
generator = new LevelGenerator(currentLevel, levels, new Random().Next());
currentLevel = generator.GenerateNewLevel(curLevelInfo, 1);
this.SetUpCameraDefault();
this.projectiles = new List<Projectile>();
this.expOrbs = new List<ExperienceOrb>();
}
开发者ID:bmaxwell921,项目名称:LandOfAmbrosia,代码行数:33,代码来源:LevelManager.cs
示例12: Tick
public override void Tick(Level l)
{
if (l.GetBlock(X, Z, Y - 1) == Block.BlockList.AIR) {
Add(l, new Active_Water(X, Z, Y - 1));
Remove(l);
//l.BlockChange((ushort)X, (ushort)Z, (ushort)(Y - 1), this);
}
else {
if (l.GetBlock(X + 1, Z, Y) == Block.BlockList.AIR) {
Add(l, new Active_Water(X + 1, Z, Y));
//l.BlockChange((ushort)(X + 1), (ushort)Z, (ushort)Y, this);
}
if (l.GetBlock(X - 1, Z, Y) == Block.BlockList.AIR) {
Add(l, new Active_Water(X - 1, Z, Y));
//l.BlockChange((ushort)(X - 1), (ushort)Z, (ushort)Y, this);
}
if (l.GetBlock(X, Z + 1, Y) == Block.BlockList.AIR) {
Add(l, new Active_Water(X, Z + 1, Y));
//l.BlockChange((ushort)X, (ushort)(Z + 1), (ushort)Y, this);
}
if (l.GetBlock(X, Z - 1, Y) == Block.BlockList.AIR) {
Add(l, new Active_Water(X, Z - 1, Y));
// l.BlockChange((ushort)X, (ushort)(Z - 1), (ushort)Y, this);
}
}
}
开发者ID:headdetect,项目名称:MCForge6-Vanilla,代码行数:26,代码来源:Active_Water.cs
示例13: Message
public void Message(string str, Level level)
{
string message = string.Format("{0}", str);
switch (level)
{
case Level.Normal:
{
System.Console.WriteLine(message);
Save(message);
break;
}
case Level.Warning:
{
message = "[Warn]" + message;
System.Console.WriteLine(message);
Save(message);
break;
}
case Level.Error:
{
message = "[Error]" + message;
System.Console.WriteLine(message);
Save(message);
break;
}
}
}
开发者ID:Letractively,项目名称:lunar-thu,代码行数:27,代码来源:Logger.cs
示例14: FunctionEntry
public FunctionEntry(Level level, Label label, Types.RECORD formals, Types.Type result)
{
Level = level;
Label = label;
Formals = formals;
Result = result;
}
开发者ID:Nxun,项目名称:Naive-Tiger,代码行数:7,代码来源:Semantics.Entry.cs
示例15: SendToLevel
public static void SendToLevel(Level l, string[] message)
{
for (int i = 0; i < message.Length; i++)
{
l.ChatLevel(message[i]);
}
}
开发者ID:jonnyli1125,项目名称:MCDawn,代码行数:7,代码来源:State.cs
示例16: forward
/**
* It the local is permissive enougth we forward the message to the master.
*/
public void forward(string caller, Level level, string message)
{
if (LevelComparator.pass(level, logLevel))
{
parentNode.forward(caller, level, message);
}
}
开发者ID:kevoree,项目名称:kevoree-dotnet-log,代码行数:10,代码来源:LoggerSlave.cs
示例17: GetBytes
public static byte[] GetBytes(Level data)
{
IFormatter formatter = new BinaryFormatter();
MemoryStream stream = new MemoryStream();
formatter.Serialize(stream, data);
return stream.ToArray();
}
开发者ID:alexkirwan29,项目名称:Cubes-Of-Wrath,代码行数:7,代码来源:LevelIO.cs
示例18: FireMarioCrouchingSprite
public FireMarioCrouchingSprite(int isMovingRight, Level level, Vector2 location)
{
this.isMovingRight = isMovingRight;
this.level = level;
this.texture = level.ContentLoad("Mario/Fire/FireCrouchingMario");
this.location = location;
}
开发者ID:KingKumar,项目名称:mario,代码行数:7,代码来源:FireMarioCrouchingSprite.cs
示例19: DestroyCurrentLevel
public void DestroyCurrentLevel() {
if (m_currentLevel != null) {
GameObject.Destroy(m_currentLevel.gameObject);
}
m_currentLevel = null;
}
开发者ID:BlakeTriana,项目名称:combat-tech-survival,代码行数:7,代码来源:LevelManager.cs
示例20: ClientConnection
/// <summary>
/// Creates a new ClientConnection instance using a socket,
/// additionally creating a player entity for the client in
/// the specified level.
/// </summary>
/// <param name="socket">Socket connected to the client.</param>
/// <param name="level">Level to create a player in.</param>
public ClientConnection(TcpClient socket, Level level)
: base(socket)
{
_socket = socket;
Level = level;
_visibility = level
.Select(x => new RoomVisibility(x))
.ToArray();
Player = Entity.Create("player");
Player.GetComponent<PlayerControl>().Client = this;
var rooms = level
.Where(x => x.Any(y => y.State == TileState.Floor))
.ToArray();
var room = rooms[(int)(DateTime.Now.Ticks % rooms.Length)];
var tiles = room
.Where(x => x.State == TileState.Floor)
.ToArray();
Player.Place(tiles[Tools.Random.Next(tiles.Length)]);
}
开发者ID:Tamschi,项目名称:FacePuncher,代码行数:32,代码来源:ClientConnection.cs
注:本文中的Level类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论