本文整理汇总了C#中ICommand.GiveFeedback方法的典型用法代码示例。如果您正苦于以下问题:C# ICommand.GiveFeedback方法的具体用法?C# ICommand.GiveFeedback怎么用?C# ICommand.GiveFeedback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICommand
的用法示例。
在下文中一共展示了ICommand.GiveFeedback方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
public static IAction Create(ICommand command)
{
if (command.Arguments.Count == 0)
{
throw new ArgumentException("At least 1 argument is required");
}
// TODO : Support passing in the final heading
CoordsObject coords;
if (command.Arguments.Count == 1)
{
// goto is being used to go to an object. Locate the object
var woId = int.Parse(command.Arguments[0]);
var woObj = woId.ToWorldObject();
if (woObj == null)
{
command.GiveFeedback(FeedbackType.Ignored, "Could not locate object : {0}", woId);
throw new DisplayToUserException(string.Format("Could not locate object : {0}", woId), command);
}
coords = woObj.Coordinates();
//x = woCoords.NorthSouth;
//y = woCoords.EastWest;
}
else if (command.Arguments.Count == 2)
{
double ns = double.Parse(command.Arguments[0]);
double ew = double.Parse(command.Arguments[1]);
coords = new CoordsObject(ns, ew);
}
else
{
// Note : In the future maybe I support more complex goto abilities.
throw new NotImplementedException("Support for more complicated goto operations has not been implemented");
}
return Create(command, coords);
}
示例2: HandleCommand
//.........这里部分代码省略.........
break;
#endregion
#region Give
case "give":
Actions.Dispatched.GiveItems.Create(command).Enqueue();
break;
#endregion
#region List
case "list":
Actions.Dispatched.ListItems.Create(command).Enqueue();
break;
#endregion
#region Cram
case "cram":
Actions.Dispatched.CramItems.Create(command).Enqueue();
break;
#endregion
#region Jumping
case "hop":
if(!SourceIsWithinJumpRange(command))
{
command.GiveFeedback(FeedbackType.Ignored, "You are too far away");
return;
}
Actions.Dispatched.Jump.CreateHop(command).Enqueue();
break;
case "shifthop":
case "shop":
if (!SourceIsWithinJumpRange(command))
{
command.GiveFeedback(FeedbackType.Ignored, "You are too far away");
return;
}
Actions.Dispatched.Jump.CreateShiftHop(command).Enqueue();
break;
case "hopfull":
case "hopf":
if (!SourceIsWithinJumpRange(command))
{
command.GiveFeedback(FeedbackType.Ignored, "You are too far away");
return;
}
Actions.Dispatched.Jump.CreateHopFull(command).Enqueue();
break;
case "shifthopfull":
case "shopf":
if (!SourceIsWithinJumpRange(command))
{
command.GiveFeedback(FeedbackType.Ignored, "You are too far away");
return;
}