Пример #1
0
        public void WhenRelationshipIsCopied_PropertiesMatch()
        {
            var theCopy = theRelationship.Copy();

            Assert.IsTrue(theRelationship != theCopy); //distinct objects/pointers
            Assert.AreEqual(theRelationship.SelfId, theCopy.SelfId);
            Assert.AreEqual(theRelationship.OtherId, theCopy.OtherId);
            Assert.AreEqual(theRelationship.Trust, theCopy.Trust);
            Assert.AreEqual(theRelationship.Ethics, theCopy.Ethics);
            Assert.AreEqual(theRelationship.DurabilityOfEthics, theCopy.DurabilityOfEthics);
            Assert.AreEqual(theRelationship.DurabilityOfTrust, theCopy.DurabilityOfTrust);
        }
Пример #2
0
    public override DatabaseEntry Copy()
    {
        ActorData data = new ActorData(key);

        data.Name  = Name;
        data.Level = Level;
        data.XP    = XP;

        data.blockAttack = blockAttack;
        data.blockMove   = blockMove;

        data.cooldownMap = cooldownMap.Copy();

        data.race       = race;
        data.primaryJob = primaryJob;
        if (secondaryJob != null)
        {
            data.secondaryJob = secondaryJob;
        }
        data.selected = selected;
        //data.CanAttack = CanAttack;
        //data.CanMove = CanMove;

        data.maxStatCollection     = (StatsContainer)maxStatCollection.Copy();
        data.currentStatCollection = (StatsContainer)currentStatCollection.Copy();

        data.equipment = (Equipment)equipment.Copy();
        data.inventory = (Inventory)inventory.Copy();

        data.controller = controller;

        if (Relationships != null)
        {
            data.Relationships = Relationships.Copy();
        }

        data.portraitFilePath    = portraitFilePath;
        data.animationController = animationController;
        data.gridPosX            = gridPosX;
        data.gridPosY            = gridPosY;

        data.buffContainer   = buffContainer.Copy();
        data.isAlive         = isAlive;
        data.toolbaar        = (ToolBarData)toolbaar.Copy();
        data.deathThreshold  = deathThreshold;
        data.directionFacing = directionFacing;

        data.description = description;

        foreach (string t in actorPropertyTags)
        {
            data.actorPropertyTags.Add(t);
        }

        data.movement     = movement;
        data.JobDataState = JobDataState.Copy();

        return(data);
    }
Пример #3
0
        public virtual OrganisationRequestToken <DisassociateResponse> DisassociateDeferred(string entityName,
                                                                                            Guid entityId, Relationship relationship, EntityReferenceCollection relatedEntities)
        {
            ValidateDeferredQueueState();
            var token =
                new OrganisationRequestToken <DisassociateResponse>
            {
                Request =
                    new DisassociateRequest
                {
                    Target          = new EntityReference(entityName, entityId),
                    Relationship    = relationship.Copy(),
                    RelatedEntities = relatedEntities.Copy()
                }
            };

            deferredRequests.Add(token);
            return(token);
        }