Beispiel #1
0
    public void GotAItem(ICommonItem commonItem)
    {
        //commonItem.GotItem();

        int itemNum = commonItem.GotItem();

        print("itemNum : " + itemNum.ToString() + " In GameManager");
    }
Beispiel #2
0
    //Observer
    public void OnTriggerEnter(Collider other)
    {
        if (other.tag == "ITEMA")
        {
            print("col ITEMA");

            ICommonItem aItem = other.gameObject.GetComponent <ICommonItem>();

            //gameManager.GotAItem(aItem);

            onNotifyGotItemE(aItem.GotItem());
        }
    }
    public override string Execute()
    {
        string itemName          = base.Arguments[0];
        string heroName          = base.Arguments[1];
        int    strengthBonus     = int.Parse(base.Arguments[2]);
        int    agilityBonus      = int.Parse(base.Arguments[3]);
        int    intelligenceBonus = int.Parse(base.Arguments[4]);
        int    hitpointsBonus    = int.Parse(base.Arguments[5]);
        int    damageBonus       = int.Parse(base.Arguments[6]);

        ICommonItem commonItem = this.commonItemFactory.CreateCommonItem(
            itemName,
            strengthBonus,
            agilityBonus,
            intelligenceBonus,
            hitpointsBonus,
            damageBonus);

        string result = base.Manager.AddItemToHero(commonItem, heroName);

        return(result);
    }