本文整理汇总了C#中IMyCubeBlock.getNameOnly方法的典型用法代码示例。如果您正苦于以下问题:C# IMyCubeBlock.getNameOnly方法的具体用法?C# IMyCubeBlock.getNameOnly怎么用?C# IMyCubeBlock.getNameOnly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMyCubeBlock
的用法示例。
在下文中一共展示了IMyCubeBlock.getNameOnly方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Logger
/// <summary>
/// Creates a Logger that gets the context and states from block and supplied function.
/// </summary>
/// <param name="calling_class">the name of the class this Logger belongs to</param>
/// <param name="block">The block to get context and states from</param>
/// <param name="default_secondary">the secondary state used when one is not supplied to alwaysLog() or debugLog()</param>
public Logger(string calling_class, IMyCubeBlock block, Func<string> default_secondary = null)
{
this.m_classname = calling_class;
this.f_context = () => block.CubeGrid.DisplayName + " - " + block.CubeGrid.EntityId;
if (default_secondary == null)
{
this.f_state_primary = () => block.DefinitionDisplayNameText;
this.f_state_secondary = () => block.getNameOnly() + " - " + block.EntityId;
}
else
{
this.f_state_primary = () => block.getNameOnly() + " - " + block.EntityId;
this.f_state_secondary = default_secondary;
}
}
示例2: Turret
public Turret(IMyCubeBlock block)
: base(block)
{
myLogger = new Logger("Turret", () => block.CubeGrid.DisplayName, () => block.DefinitionDisplayNameText, () => block.getNameOnly());
Registrar.Add(CubeBlock, this);
//myLogger.debugLog("definition limits = " + definition.MinElevationDegrees + ", " + definition.MaxElevationDegrees + ", " + definition.MinAzimuthDegrees + ", " + definition.MaxAzimuthDegrees, "Turret()");
//myLogger.debugLog("radian limits = " + minElevation + ", " + maxElevation + ", " + minAzimuth + ", " + maxAzimuth, "Turret()");
}
示例3: InterpreterWeapon
public InterpreterWeapon(IMyCubeBlock block)
: base(block as IMyTerminalBlock)
{
this.Block = block;
this.Grid = block.CubeGrid;
myLogger = new Logger("InterpreterWeapon", () => Grid.DisplayName, () => Block.DefinitionDisplayNameText, () => Block.getNameOnly());
}
示例4: InterpreterWeapon
public InterpreterWeapon(IMyCubeBlock block)
{
this.Block = block;
this.Grid = block.CubeGrid;
this.m_instructions = new BlockInstructions(block as IMyTerminalBlock, OnInstruction);
myLogger = new Logger("InterpreterWeapon", () => Grid.DisplayName, () => Block.DefinitionDisplayNameText, () => Block.getNameOnly());
}
示例5: InterpreterWeapon
public InterpreterWeapon(IMyCubeBlock block)
: base(block)
{
this.Block = block;
this.Grid = block.CubeGrid;
myLogger = new Logger("InterpreterWeapon", () => Grid.DisplayName, () => Block.DefinitionDisplayNameText, () => Block.getNameOnly()) { MinimumLevel = Logger.severity.INFO };
}
示例6: Logger
/// <summary>
/// Creates a Logger that gets the context and states from block and supplied function.
/// </summary>
/// <param name="calling_class">the name of the class this Logger belongs to</param>
/// <param name="block">The block to get context and states from</param>
/// <param name="default_secondary">the secondary state used when one is not supplied to alwaysLog() or debugLog()</param>
public Logger(string calling_class, IMyCubeBlock block, Func<string> default_secondary = null)
{
this.m_classname = calling_class;
if (block == null)
{
f_context = () => "Null block";
return;
}
this.f_context = () => {
IMyCubeGrid grid = block.CubeGrid;
if (grid == null)
return "Null grid";
return grid.DisplayName + " - " + grid.EntityId;
};
if (default_secondary == null)
{
this.f_state_primary = () => block.DefinitionDisplayNameText;
this.f_state_secondary = () => block.getNameOnly() + " - " + block.EntityId;
}
else
{
this.f_state_primary = () => block.getNameOnly() + " - " + block.EntityId;
this.f_state_secondary = default_secondary;
}
}