Example #1
0
 private void WhenDestroyArtefact(IPeer peer, ArtefactAction action)
 {
     if (peer.HasArtefact(action.Model.Id))
     {
         _actor.Account.ForgetArtefact(action.Model.Id);
     }
     else
     {
         peer.DecreaseTrust(DestroyOthersArtefactDistrustFactor);
     }
 }
Example #2
0
 private void WhenCreateArtefact(IPeer peer, ArtefactAction action)
 {
     if (peer.HasArtefact(action.Model.Id))
     {
         return;
     }
     if (_actor.Account.KnowsArtefact(action.Model.Id))
     {
         peer.DecreaseTrust(MakeCounterfeitArtefactDistrustFactor);
     }
     else
     {
         _actor.Account.AddArtefact(action.Model, peer.Id);
     }
 }
Example #3
0
        private void WhenEndorceArtefact(IPeer peer, ArtefactAction action)
        {
            var artefact = action.Model;

            if (_actor.Account.KnowsArtefact(action.Model.Id))
            {
                artefact = _actor.Account.GetArtefact(artefact.Id);
                if (artefact.OwnerId != action.Model.OwnerId)
                {
                    peer.DecreaseTrust(EndorceCounterfeitArtefactDistrustFactor);
                    return;
                }
            }
            else
            {
                _actor.Account.RememberArtefact(artefact);
            }

            var relation = ProduceRelation(peer, artefact.OwnerId);

            AddMoneyFromEndorcement(peer, relation, ArtefactMoneyFactor);
            relation.IncreaseStrength(ArtefactEndorcementTrustFactor);
        }