本文整理匯總了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." );
}
}
示例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." );
}
}
示例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");
}
}