当前位置: 首页>>代码示例>>C#>>正文


C# IMyCubeBlock.getNameOnly方法代码示例

本文整理汇总了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;
			}
		}
开发者ID:helppass,项目名称:Autopilot,代码行数:22,代码来源:Logger.cs

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

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

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

示例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 };
        }
开发者ID:Souper07,项目名称:Autopilot,代码行数:8,代码来源:InterpreterWeapon.cs

示例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;
            }
        }
开发者ID:Souper07,项目名称:Autopilot,代码行数:34,代码来源:Logger.cs


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