本文整理汇总了C#中EntityId类的典型用法代码示例。如果您正苦于以下问题:C# EntityId类的具体用法?C# EntityId怎么用?C# EntityId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EntityId类属于命名空间,在下文中一共展示了EntityId类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
****************************/
}
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:30,代码来源:ArmorerMgr.cs
示例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;
}
开发者ID:Egipto87,项目名称:DOOP.ec,代码行数:26,代码来源:Data.cs
示例3: EventDescriptor
public EventDescriptor(CommandId commandId, EntityId id, IEvent eventData, int entityVersion)
{
CommandId = commandId;
EventData = eventData;
Version = entityVersion;
EntityId = id;
}
开发者ID:dgmachado,项目名称:EventSourcingAndCQRSLib,代码行数:7,代码来源:EventDescriptor.cs
示例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;
}
}
开发者ID:dgmachado,项目名称:EventSourcingAndCQRSLib,代码行数:28,代码来源:EventStore.cs
示例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);
}
开发者ID:rafalrosochacki,项目名称:RomanticWeb,代码行数:26,代码来源:TripleExtentions.cs
示例7: NpcEntity
public NpcEntity(EntityId id, EntityId ownerId, Entity owner,NpcInfo info)
: base(id)
{
OwnerId = ownerId;
Owner = owner;
Info = info;
}
开发者ID:gothos-folly,项目名称:TeraDamageMeter,代码行数:7,代码来源:NpcEntity.cs
示例8: CasterInfo
public CasterInfo(WorldObject caster)
{
CasterId = caster.EntityId;
Level = caster.CasterLevel;
m_caster = caster;
//Faction = caster.Faction;
//ObjectType = caster.Type;
}
开发者ID:pallmall,项目名称:WCell,代码行数:8,代码来源:CasterInfo.cs
示例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"));
}
开发者ID:rafalrosochacki,项目名称:RomanticWeb,代码行数:8,代码来源:EntityTripleTests.cs
示例10: ObjectReference
public ObjectReference(WorldObject obj)
{
EntityId = obj.EntityId;
Level = obj.CasterLevel;
m_Object = obj;
//Faction = caster.Faction;
//ObjectType = caster.Type;
}
开发者ID:Zerant,项目名称:WCell,代码行数:8,代码来源:ObjectReference.cs
示例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);
}
开发者ID:alien-mcl,项目名称:URSA,代码行数:8,代码来源:OwningResourceNamedGraphSelector_class.cs
示例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);
}
开发者ID:alien-mcl,项目名称:URSA,代码行数:8,代码来源:OwningResourceNamedGraphSelector_class.cs
示例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());
}
开发者ID:rafalrosochacki,项目名称:RomanticWeb,代码行数:10,代码来源:TripleStoreAdapter.cs
示例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;
}
开发者ID:pallmall,项目名称:WCell,代码行数:14,代码来源:TestFakeClient.cs
示例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);
}
开发者ID:Zerant,项目名称:WCell,代码行数:9,代码来源:ObjectReference.cs
示例16: GetOrCreate
public static CasterInfo GetOrCreate(Region rgn, EntityId id)
{
var caster = rgn.GetObject(id);
if (caster != null)
{
return caster.CasterInfo;
}
return new CasterInfo(id, 1);
}
开发者ID:pallmall,项目名称:WCell,代码行数:9,代码来源:CasterInfo.cs
示例17: ToEntityQuad
public static EntityQuad ToEntityQuad(this VDS.RDF.Triple triple, EntityId id)
{
return new EntityQuad(
id,
triple.Subject.ToNode(id),
triple.Predicate.ToNode(id),
triple.Object.ToNode(id),
Node.ForUri(triple.GraphUri));
}
开发者ID:rafalrosochacki,项目名称:RomanticWeb,代码行数:9,代码来源:TripleExtentions.cs
示例18: GetSerializedJson
private dynamic GetSerializedJson(EntityId id, Stream resource)
{
string json = _processor.FromRdf(GetQuads(id, resource));
object deserializeObject = JsonConvert.DeserializeObject(Regex.Replace(json, "\"_:autos[0-9]+\"", "\"_:blank\""));
Console.WriteLine("Result JSON:");
Console.WriteLine(deserializeObject.ToString());
return deserializeObject;
}
开发者ID:rafalrosochacki,项目名称:RomanticWeb,代码行数:10,代码来源:JsonLdProcessorTests.cs
示例19: SelectGraph
public Uri SelectGraph(EntityId entityId, IEntityMapping entityMapping, IPropertyMapping predicate)
{
EntityId nonBlankId = entityId;
if (nonBlankId is BlankId)
{
nonBlankId = ((BlankId)nonBlankId).RootEntityId;
}
return new Uri(System.Text.RegularExpressions.Regex.Replace((nonBlankId != null ? nonBlankId.Uri.AbsoluteUri : ((BlankId)entityId).Graph.AbsoluteUri), "((?<!data.)magi)", "data.magi"));
}
开发者ID:rafalrosochacki,项目名称:RomanticWeb,代码行数:10,代码来源:TestGraphSelector.cs
示例20: CheckIfAlreadySavedEntityHasAnySavedEvent
private void CheckIfAlreadySavedEntityHasAnySavedEvent(EntityId entityId, int expectedEntityVersion)
{
if (!EqualsNewEntityVersion(expectedEntityVersion))
{
if (!HasAnySavedEventFor(entityId))
{
ThrowConcurrencyException(entityId, expectedEntityVersion, NewEntityVersion);
}
}
}
开发者ID:dgmachado,项目名称:EventSourcingAndCQRSLib,代码行数:10,代码来源:EventStore.cs
注:本文中的EntityId类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论