本文整理汇总了C#中EntityId类的典型用法代码示例。如果您正苦于以下问题:C# EntityId类的具体用法?C# EntityId怎么用?C# EntityId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EntityId类属于命名空间,在下文中一共展示了EntityId类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RepairItem
public static void RepairItem(IRealmClient client, NPC armorer, EntityId itemId, bool useGuildFunds)
{
var curChar = client.ActiveCharacter;
uint totalCost = 0;
if (itemId.Low != 0)
{
// Repairing an individual item.
var item = GetItemByEntityId(curChar, itemId);
if (item == null)
return;
if (!ArmorerCheatChecks(curChar, armorer, item))
return;
totalCost += RepairItem(curChar, armorer, item, useGuildFunds);
}
else
{
// Case Repair all
if (!ArmorerCheatChecks(curChar, armorer))
return;
totalCost += RepairAllItems(curChar, armorer, useGuildFunds);
}
if (useGuildFunds)
{
/****************************
* TODO: record the funds usage in the guild log
****************************/
}
}
示例2: Data
public Data(EntityId readerId, EntityId writerId, long seqNum, ParameterList inlineQosParams, DataEncapsulation dEnc)
: base(SubMessageKind.DATA)
{
this.readerId = readerId;
this.writerId = writerId;
this.writerSN = new SequenceNumber(seqNum);
if (inlineQosParams != null && inlineQosParams.Count > 0)
{
Header.FlagsValue |= 0x2;
this.inlineQosParams = inlineQosParams;
}
if (dEnc.ContainsData())
{
Header.FlagsValue |= Flags.DataFlag; // dataFlag
}
else
{
Header.FlagsValue |= Flags.KeyFlag; // keyFlag
}
this.dataEncapsulation = dEnc;
}
示例3: EventDescriptor
public EventDescriptor(CommandId commandId, EntityId id, IEvent eventData, int entityVersion)
{
CommandId = commandId;
EventData = eventData;
Version = entityVersion;
EntityId = id;
}
示例4: CheckIfEventsAreUpdated
private void CheckIfEventsAreUpdated(EntityId entityId, int expectedEntityVersion)
{
try
{
if (!EqualsNewEntityVersion(expectedEntityVersion))
{
if (!DoesLatestEventVersionMatchVersion(entityId, expectedEntityVersion))
{
ThrowConcurrencyException(entityId, expectedEntityVersion, CurrentEntityVersion(entityId));
}
}
}
catch (NoEventsWereFoundException e)
{
Log.Error("Throwing a NoEventsWereFoundException on saving events for entityId '{0}' expected entity version '{1}'!", entityId, expectedEntityVersion);
throw e;
}
catch (ConcurrencyException e)
{
Log.Error("Throwing a ConcurrencyException on saving events for entityId '{0}', expected entity version '{1}' and current entity version '{2}'!", e.EntityId, e.ExpectedEntityVersion, e.CurrentEntityVersion);
throw e;
}
catch (Exception e)
{
Log.Error("Throwing a unknown exception on saving events for entityId '{0}' expected entityVersion '{1}'!", entityId, expectedEntityVersion);
throw e;
}
}
示例5: ApplyingEventWithUnexpectedVersionException
public ApplyingEventWithUnexpectedVersionException(EntityId entityId, int currentVersion, int eventVersion)
: base()
{
EntityId = entityId;
CurrentVersion = currentVersion;
EventVersion = eventVersion;
}
开发者ID:dgmachado,项目名称:EventSourcingAndCQRSLib,代码行数:7,代码来源:ApplyingEventWithUnexpectedVersionException.cs
示例6: ToNode
private static Node ToNode(this INode node, EntityId id)
{
if (node is IUriNode)
{
return Node.ForUri(((IUriNode)node).Uri);
}
if (node is IBlankNode)
{
return Node.ForBlank(((IBlankNode)node).InternalID, id, node.GraphUri);
}
var literal = (ILiteralNode)node;
if (literal.DataType != null)
{
return Node.ForLiteral(literal.Value, literal.DataType);
}
if (literal.Language != null)
{
return Node.ForLiteral(literal.Value, literal.Language);
}
return Node.ForLiteral(literal.Value);
}
示例7: NpcEntity
public NpcEntity(EntityId id, EntityId ownerId, Entity owner,NpcInfo info)
: base(id)
{
OwnerId = ownerId;
Owner = owner;
Info = info;
}
示例8: CasterInfo
public CasterInfo(WorldObject caster)
{
CasterId = caster.EntityId;
Level = caster.CasterLevel;
m_caster = caster;
//Faction = caster.Faction;
//ObjectType = caster.Type;
}
示例9: FixtureSetup
public void FixtureSetup()
{
_validSubject = Node.ForUri(new Uri("http://magi/test/subject"));
_validObject = Node.ForUri(new Uri("http://magi/test/object"));
_validPredicate = Node.ForUri(new Uri("http://magi/test/predicate"));
_graph = Node.ForUri(new Uri("urn:some:graph"));
_entityId = new EntityId(new Uri("http://magi/test/subject"));
}
示例10: ObjectReference
public ObjectReference(WorldObject obj)
{
EntityId = obj.EntityId;
Level = obj.CasterLevel;
m_Object = obj;
//Faction = caster.Faction;
//ObjectType = caster.Type;
}
示例11: it_should_match_uri
public void it_should_match_uri()
{
var entityId = new EntityId((Uri)(BaseUri + EntryPoint).AddSegment(Guid.Empty.ToString()));
Uri result = _selector.SelectGraph(entityId, null, null);
result.Should().Be(entityId.Uri);
}
示例12: it_should_match_uri_with_query_string_parameters
public void it_should_match_uri_with_query_string_parameters()
{
var entityId = new EntityId((Uri)(BaseUri + EntryPoint).AddSegment(Guid.Empty.ToString()).WithParameter("_random", "10"));
Uri result = _selector.SelectGraph(entityId, null, null);
result.Should().Be(entityId.Uri);
}
示例13: EntityExist
/// <summary>Executes an ASK query to perform existence check.</summary>
public bool EntityExist(EntityId entityId)
{
var ask = QueryBuilder.Ask()
.Graph(
MetaGraphUri,
graph => graph.Where(triple => triple.Subject("g").PredicateUri("foaf:primaryTopic").Object(entityId.Uri)));
ask.Prefixes.Import(_namespaces);
return ExecuteAsk(ask.BuildQuery());
}
示例14: GetUpdateBlocks
/// <summary>
/// Gets the last received update blocks of the object with the given id and of the given Type
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
public ICollection<UpdateBlock> GetUpdateBlocks(EntityId id, UpdateType type)
{
var blocks = new List<UpdateBlock>();
foreach (var packet in UpdatePackets)
{
packet.GetBlocks(id, type, blocks);
}
return blocks;
}
示例15: GetOrCreate
public static ObjectReference GetOrCreate(Map rgn, EntityId id)
{
var caster = rgn.GetObject(id);
if (caster != null)
{
return caster.SharedReference;
}
return new ObjectReference(id, 1);
}