當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。