本文整理汇总了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");
}
}