コード例 #1
0
ファイル: AgentInventory.cs プロジェクト: pandaboy/Village
    public AgentInventory(PlayerController Owner)
    {
        OwnerDetails = Owner.CharDetails;
        OwnerCue = Owner.CharacterCue;
        OwnerMind = Owner.MindsEye;

        EquippedUID = string.Empty;
    }
コード例 #2
0
ファイル: AgentInventory.cs プロジェクト: pandaboy/Village
    public AgentInventory(CognitiveAgent Owner)
    {
        OwnerDetails = Owner.CharDetails;
        OwnerCue = Owner.CharacterCue;
        OwnerMind = Owner.MindsEye;

        EquippedUID = string.Empty;
    }
コード例 #3
0
ファイル: ShopManager.cs プロジェクト: pandaboy/Village
    public void OpenShop(CharacterCue owner)
    {
        ShopOpen = true;

        for (int i = 0; i < ShopItems.Length; i++)
            if(ShopItems[i] != null)
                ShopItems[i].Owner = owner;
    }
コード例 #4
0
ファイル: MemoryGraph.cs プロジェクト: pandaboy/Village
 public CharacterNode(CharacterCue charInfo)
     : base(charInfo, MemoryType.Character)
 {}
コード例 #5
0
ファイル: MemoryGraph.cs プロジェクト: pandaboy/Village
    public override void UpdateMemory(MemoryGraph memoryGraph, MemoryGraphNode retainedMemory, MemoryCue memCue, float UpdateFrequency)
    {
        ItemCue itemInfo = (ItemCue)memCue;

        status = itemInfo.Status;
        owner = itemInfo.Owner;
        durability = itemInfo.Durability;

        if (durability < 0.0f)
        {
            //Once durability starts to fall, a agent's affinity with an item will also drop.
            memoryGraph.UpdateCueOpinion(retainedMemory.MemoryNode, -UpdateFrequency);
        }

        base.UpdateMemory(memoryGraph, retainedMemory, memCue, UpdateFrequency);

        if (UpdateFrequency <= 0.0f || itemInfo.Owner == null)    //We want to strengthen the memory between the specific item and the place it has been observed.
            return;

        MemoryGraphNode charNode;
        if (memoryGraph.Contains(itemInfo.Owner.UniqueNodeID))
            charNode = memoryGraph.GetNamedNodeFromGraph(itemInfo.Owner.UniqueNodeID);
        else
            charNode = memoryGraph.AddNamedNodeToGraph(new CharacterNode(itemInfo.Owner));

        //First make a connection between the character and the item.
        int index = charNode.Neighbours.IndexOf(retainedMemory);
        if (index == -1)
            memoryGraph.AddDirectedEdge(charNode, retainedMemory, UpdateFrequency, UpdateFrequency);
        else
        {
            //Strengthing the memory based on the length of time it was active in the working set.
            charNode.StrengthenMemory(index, UpdateFrequency);
            //charNode.OpinionStrengths[index] += UpdateFrequency;
        }

        //Then between the item and the character.
        index = retainedMemory.Neighbours.IndexOf(charNode);
        if (index == -1)
            memoryGraph.AddDirectedEdge(retainedMemory, charNode, UpdateFrequency, UpdateFrequency);
        else
        {
            //Strengthing the memory based on the length of time it was active in the working set.
            retainedMemory.StrengthenMemory(index, UpdateFrequency);
            //retainedMemory.OpinionStrengths[index] += UpdateFrequency;
        }
    }
コード例 #6
0
ファイル: MemoryGraph.cs プロジェクト: pandaboy/Village
 public ItemNode(ItemCue itemInfo)
     : base(itemInfo, MemoryType.Item)
 {
     status = itemInfo.Status;
     owner = itemInfo.Owner;
     durability = itemInfo.Durability;
 }