public static Invoice Create( DateTime issueDate, DateTime dueDate, List <InvoiceItem> items, List <InvoicePayment> payments, EntitySupplier supplier, EntityReceiver reciever ) { return(new Invoice(null, issueDate, dueDate, null, items, payments, supplier, reciever)); }
public override string Print(bool link = true, DwarfObject pov = null) { string eventString = GetYearTime(); eventString += Artifact.ToLink(link, pov, this); eventString += " was offered to "; if (HistoricalFigureReceiver != null) { eventString += HistoricalFigureReceiver.ToLink(link, pov, this); if (EntityReceiver != null) { eventString += " of "; } } if (EntityReceiver != null) { eventString += EntityReceiver.ToLink(link, pov, this); } eventString += " by "; if (HistoricalFigureGiver != null) { eventString += HistoricalFigureGiver.ToLink(link, pov, this); if (EntityGiver != null) { eventString += " of "; } } if (EntityGiver != null) { eventString += EntityGiver.ToLink(link, pov, this); } if (ArtifactReason != ArtifactReason.Unknown) { switch (ArtifactReason) { case ArtifactReason.CementBondsOfFriendship: eventString += " in order to cement the bonds of friendship"; break; case ArtifactReason.PartOfTradeNegotiation: eventString += " as part of a trade negotiation"; break; } } eventString += PrintParentCollection(link, pov); eventString += "."; return(eventString); }
public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem) { dstManager.AddComponentData(entity, new SentEntity() { }); foreach (var EntityReceiver in EntityReceivers) { var potentialReceivers = EntityReceiver.GetComponents <MonoBehaviour>(); foreach (var potentialReceiver in potentialReceivers) { if (potentialReceiver is IReceiveEntity receiver) { receiver.SetReceivedEntity(entity); } } } }
// http://www.bay12games.com/dwarves/mantisbt/view.php?id=11350 // 0011350: "artifact given" event sometimes has the same <giver_hist_figure_id> and <receiver_hist_figure_id> public ArtifactGiven(List <Property> properties, World world) : base(properties, world) { foreach (Property property in properties) { switch (property.Name) { case "artifact_id": Artifact = world.GetArtifact(Convert.ToInt32(property.Value)); break; case "giver_hist_figure_id": HistoricalFigureGiver = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break; case "receiver_hist_figure_id": HistoricalFigureReceiver = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break; case "giver_entity_id": EntityGiver = world.GetEntity(Convert.ToInt32(property.Value)); break; case "receiver_entity_id": EntityReceiver = world.GetEntity(Convert.ToInt32(property.Value)); break; case "reason": switch (property.Value) { case "cement bonds of friendship": ArtifactReason = ArtifactReason.CementBondsOfFriendship; break; case "part of trade negotiation": ArtifactReason = ArtifactReason.PartOfTradeNegotiation; break; default: property.Known = false; break; } break; } } Artifact.AddEvent(this); HistoricalFigureGiver.AddEvent(this); if (HistoricalFigureGiver != HistoricalFigureReceiver) { HistoricalFigureReceiver.AddEvent(this); } EntityGiver.AddEvent(this); EntityReceiver.AddEvent(this); }
public InvoiceDomain ToDomain( List <InvoiceItem> items, List <InvoicePayment> payments, EntitySupplier supplier, EntityReceiver receiver ) { return(new InvoiceDomain( new SimpleObjectIdentifier(Id ?? throw new DataException("InvoiceEntity Id is null")), IssueDate, DueDate, RedemptionDate, items, payments, supplier, receiver )); }
public Invoice( IObjectIdentifier <ulong> id, DateTime issueDate, DateTime dueDate, DateTime?redemptionDate, List <InvoiceItem> items, List <InvoicePayment> payments, EntitySupplier supplier, EntityReceiver receiver ) { Id = id; IssueDate = issueDate; DueDate = dueDate; RedemptionDate = redemptionDate; Items = items; Payments = payments; Supplier = supplier; Receiver = receiver; }