本文整理汇总了C#中System.Drawing.Point.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# System.Drawing.Point.ToString方法的具体用法?C# System.Drawing.Point.ToString怎么用?C# System.Drawing.Point.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.Point
的用法示例。
在下文中一共展示了System.Drawing.Point.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1:
public Tile this[DPoint point]
{
get {
#if DEBUG
Contract.Assert(TerrariaUtils.Tiles.IsValidCoord(point.X, point.Y), point.ToString());
#endif
return Main.tile[point.X, point.Y];
}
}
示例2: RefillChestManyCommand_Exec
//.........这里部分代码省略.........
if (!int.TryParse(args.Parameters[i + 1], out lootTimeAmount) || lootTimeAmount < 0) {
invalidSyntax = true;
break;
}
lootLimit = lootTimeAmount;
i++;
} else if (param.Equals("+al", StringComparison.InvariantCultureIgnoreCase))
autoLock = true;
else if (param.Equals("+fl", StringComparison.InvariantCultureIgnoreCase))
fairLoot = true;
else if (param.Equals("-al", StringComparison.InvariantCultureIgnoreCase))
autoLock = false;
else if (param.Equals("+ae", StringComparison.InvariantCultureIgnoreCase))
autoEmpty = true;
else if (param.Equals("-ae", StringComparison.InvariantCultureIgnoreCase))
autoEmpty = false;
else
timeParameters++;
}
if (!invalidSyntax && timeParameters > 0) {
if (!TimeSpanEx.TryParseShort(
args.ParamsToSingleString(1, args.Parameters.Count - timeParameters - 1), out refillTime
)) {
invalidSyntax = true;
}
}
}
ChestKind chestKindToSelect = ChestKind.Unknown;
switch (selector) {
case "dungeon":
chestKindToSelect = ChestKind.DungeonChest;
break;
case "sky":
chestKindToSelect = ChestKind.SkyIslandChest;
break;
case "ocean":
chestKindToSelect = ChestKind.OceanChest;
break;
case "shadow":
chestKindToSelect = ChestKind.HellShadowChest;
break;
case "hardmodedungeon":
chestKindToSelect = ChestKind.HardmodeDungeonChest;
break;
case "pyramid":
chestKindToSelect = ChestKind.PyramidChest;
break;
default:
invalidSyntax = true;
break;
}
if (invalidSyntax) {
args.Player.SendErrorMessage("Proper syntax: /refillchestmany <selector> [time] [+ot|-ot] [+ll amount|-ll] [+al|-al] [+ae|-ae] [+fl]");
args.Player.SendErrorMessage("Type /refillchestmany help to get more help to this command.");
return;
}
if (chestKindToSelect != ChestKind.Unknown) {
int createdChestsCounter = 0;
for (int i = 0; i < Main.chest.Length; i++) {
Chest chest = Main.chest[i];
if (chest == null)
continue;
DPoint chestLocation = new DPoint(chest.x, chest.y);
if (!TerrariaUtils.Tiles[chestLocation].active() || TerrariaUtils.Tiles[chestLocation].type != (int)BlockType.Chest)
continue;
if (TerrariaUtils.Tiles.GuessChestKind(chestLocation) != chestKindToSelect)
continue;
try {
ProtectionEntry protection = this.ProtectionManager.CreateProtection(args.Player, chestLocation, false);
protection.IsSharedWithEveryone = this.Config.AutoShareRefillChests;
} catch (AlreadyProtectedException) {
if (!this.ProtectionManager.CheckBlockAccess(args.Player, chestLocation, true) && !args.Player.Group.HasPermission(ProtectorPlugin.ProtectionMaster_Permission)) {
args.Player.SendWarningMessage($"You did not have access to convert chest {TShock.Utils.ColorTag(chestLocation.ToString(), Color.Red)} into a refill chest.");
continue;
}
} catch (Exception ex) {
this.PluginTrace.WriteLineWarning($"Failed to create protection at {TShock.Utils.ColorTag(chestLocation.ToString(), Color.Red)}: \n{ex}");
}
try {
this.ChestManager.SetUpRefillChest(
args.Player, chestLocation, refillTime, oneLootPerPlayer, lootLimit, autoLock, autoEmpty, fairLoot
);
createdChestsCounter++;
} catch (Exception ex) {
this.PluginTrace.WriteLineWarning($"Failed to create / update refill chest at {TShock.Utils.ColorTag(chestLocation.ToString(), Color.Red)}: \n{ex}");
}
}
args.Player.SendSuccessMessage($"{TShock.Utils.ColorTag(createdChestsCounter.ToString(), Color.Red)} refill chests were created / updated.");
}
}
示例3: HandleTileEdit
public override bool HandleTileEdit(TSPlayer player, TileEditType editType, BlockType blockType, DPoint location, int objectStyle)
{
if (this.IsDisposed)
return false;
if (base.HandleTileEdit(player, editType, blockType, location, objectStyle))
return true;
if (editType == TileEditType.PlaceTile)
return this.HandleTilePlace(player, blockType, location, objectStyle);
if (editType == TileEditType.TileKill || editType == TileEditType.TileKillNoItem)
return this.HandleTileDestruction(player, location);
if (editType == TileEditType.PlaceWire || editType == TileEditType.PlaceWireBlue || editType == TileEditType.PlaceWireGreen)
return this.HandleWirePlace(player, location);
#if DEBUG || Testrun
if (editType == TileEditType.DestroyWire) {
player.SendMessage(location.ToString(), Color.Aqua);
if (!TerrariaUtils.Tiles[location].active())
return false;
ObjectMeasureData measureData = TerrariaUtils.Tiles.MeasureObject(location);
player.SendInfoMessage(string.Format(
"X: {0}, Y: {1}, FrameX: {2}, FrameY: {3}, Origin X: {4}, Origin Y: {5}, Active State: {6}",
location.X, location.Y, TerrariaUtils.Tiles[location].frameX, TerrariaUtils.Tiles[location].frameY,
measureData.OriginTileLocation.X, measureData.OriginTileLocation.Y,
TerrariaUtils.Tiles.ObjectHasActiveState(measureData)
));
}
#endif
return false;
}