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


C# Player.SelectionAddMark方法代码示例

本文整理汇总了C#中fCraft.Player.SelectionAddMark方法的典型用法代码示例。如果您正苦于以下问题:C# Player.SelectionAddMark方法的具体用法?C# Player.SelectionAddMark怎么用?C# Player.SelectionAddMark使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在fCraft.Player的用法示例。


在下文中一共展示了Player.SelectionAddMark方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ZoneMarkHandler

        static void ZoneMarkHandler( Player player, Command cmd )
        {
            if( player.SelectionMarksExpected == 0 ) {
                player.MessageNow( "Cannot use ZMark - no selection in progress." );
            } else if( player.SelectionMarksExpected == 2 ) {
                string zoneName = cmd.Next();
                if( zoneName == null ) {
                    CdZoneMark.PrintUsage( player );
                    return;
                }

                Zone zone = player.WorldMap.Zones.Find( zoneName );
                if( zone == null ) {
                    player.MessageNoZone( zoneName );
                    return;
                }

                player.SelectionResetMarks();
                player.SelectionAddMark( zone.Bounds.MinVertex, false );
                player.SelectionAddMark( zone.Bounds.MaxVertex, true );
            } else {
                player.MessageNow( "ZMark can only be used for 2-block selection." );
            }
        }
开发者ID:Desertive,项目名称:800craft,代码行数:24,代码来源:ZoneCommands.cs

示例2: MarkHandler

        static void MarkHandler( Player player, CommandReader cmd ) {
            Map map = player.WorldMap;
            int x, y, z;
            Vector3I coords;
            if( cmd.NextInt( out x ) && cmd.NextInt( out y ) && cmd.NextInt( out z ) ) {
                if( cmd.HasNext ) {
                    CdMark.PrintUsage( player );
                    return;
                }
                coords = new Vector3I( x, y, z );
            } else {
                coords = player.Position.ToBlockCoords();
            }
            coords.X = Math.Min( map.Width - 1, Math.Max( 0, coords.X ) );
            coords.Y = Math.Min( map.Length - 1, Math.Max( 0, coords.Y ) );
            coords.Z = Math.Min( map.Height - 1, Math.Max( 0, coords.Z ) );

            if( player.SelectionMarksExpected > 0 ) {
                player.SelectionAddMark( coords, true, true );
            } else {
                player.MessageNow( "Cannot mark - no selection in progress." );
            }
        }
开发者ID:fragmer,项目名称:fCraft,代码行数:23,代码来源:BuildingCommands.cs

示例3: MarkAllHandler

 private static void MarkAllHandler(Player player, CommandReader cmd) {
     Map map = player.WorldMap;
     Vector3I coordsMin;
     Vector3I coordsMax;
     coordsMin.X = 0;
     coordsMin.Y = 0;
     coordsMin.Z = 0;
     coordsMax.X = map.Width - 1;
     coordsMax.Y = map.Length - 1;
     coordsMax.Z = map.Height - 1;
     if (player.IsMakingSelection) {
         player.SelectionResetMarks();
         player.SelectionAddMark(coordsMin, false, false);
         player.SelectionAddMark(coordsMax, true, true);
     } else {
         player.Message("No selection in progress");
     }
 }
开发者ID:Magi1053,项目名称:ProCraft,代码行数:18,代码来源:BuildingCommands.cs


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