示例#1
0
    /// <summary>
    /// Advances Packet to the next room.
    /// Updates packet with new room data.
    /// Returns : TRUE if packet has completed dungeon
    /// </summary>
    /// <param name="packet"></param>
    public bool UpdatePacketToNextRoom(string packet_key)
    {
        PartyController party = m_questingParties[packet_key].GetComponent <PartyController>();

        if (party != null)
        {
            //  We move in the list from last->first
            bool completed_dungeon = (0 > party.AdvanceRoom());

            if (completed_dungeon)
            {
                //  TODO aherrera : Party has defeated the boss?
                party.SetState(PartyState.PARTY_SUCCESS);
            }
            else
            {
                RoomModel party_new_current_room = mDungeonModel.GetRoom(party.GetCurrentRoomIndex());
                if (party_new_current_room != null)
                {
                    InitializePacketToRoom(packet_key);
                }
            }

            return(completed_dungeon);
        }
        else
        {
            Debug.LogError("DungeonModel::UpdatePacketToNextRoom -- packet not found in list with string: " + packet_key);
        }

        //  Hey pls don't be here
        //  TODO aherrera : handle these kinds of errors to search out and erase traces of this packet?
        return(false);
    }