Exemplo n.º 1
0
    public void AddGeneral(int generalID)
    {
        GeneralInfo general = GamePublic.Instance.DataManager.GetGeneralInfo(generalID);

        if (general.KingID != KingID)
        {
            Debugging.LogError("Function:AddGeneral; KingID:" + KingID + ", general.KingID:" + general.KingID);
            return;
        }

        if (Generals.Contains(generalID))
        {
            return;
        }

        general.CityID = ID;
        Generals.Add(generalID);
    }
Exemplo n.º 2
0
    public void AddGeneral(int generalID)
    {
        if (Generals.Contains(generalID))
        {
            return;
        }

        Generals.Add(generalID);

        GeneralInfo general = GamePublic.Instance.DataManager.GetGeneralInfo(generalID);

        if (general.KingID != 0)
        {
            KingInfo king = GamePublic.Instance.DataManager.GetKingInfo(general.KingID);
            king.RemoveGeneral(generalID);
        }

        general.KingID = ID;
    }