Beispiel #1
0
    public pd_TeamData CreateSaveData()
    {
        pd_TeamData data = new pd_TeamData();

        data.team_type             = TeamType;
        data.is_auto               = IsAuto;
        data.is_fast               = IsFast;
        data.use_leader_skill_type = UseLeaderSkillType;
        data.leader_creature_idx   = m_LeaderCreature == null ? 0 : m_LeaderCreature.Idx;
        data.creature_infos        = m_Creatures.Select(c => new pd_TeamCreature {
            team_creature_idx = c.creature.Idx, auto_skill_index = c.auto_skill_index
        }).ToList();
        data.no_duplicate = NoDuplicate;

        return(data);
    }
    void OnConfirm(bool is_confirm)
    {
        if (is_confirm)
        {
            pd_TeamData team_data = new pd_TeamData();
            team_data.team_type      = (pe_Team)m_Info.IDN;
            team_data.creature_infos = new List <pd_TeamCreature>();
            team_data.no_duplicate   = true;
            m_Selected.ForEach(c => team_data.creature_infos.Add(new pd_TeamCreature(c.Creature.Idx)));

            C2G.AdventureBegin packet = new C2G.AdventureBegin();
            packet.map_id    = m_Info.ID;
            packet.team_data = team_data;
            Network.GameServer.JsonAsync <C2G.AdventureBegin, C2G.AdventureBeginAck>(packet, OnAdventureBegin);
            return;
        }
    }
Beispiel #3
0
 public TeamData(pd_TeamData data)
 {
     TeamType           = data.team_type;
     IsAuto             = data.is_auto;
     IsFast             = data.is_fast;
     UseLeaderSkillType = data.use_leader_skill_type;
     m_Creatures        = data.creature_infos.Select(c => new TeamCreature(c)).Where(c => c.creature != null).ToList();
     m_Creatures2       = m_Creatures;
     if (data.leader_creature_idx != 0)
     {
         var leader_creature = m_Creatures.Find(e => e.creature.Idx == data.leader_creature_idx);
         if (leader_creature != null)
         {
             m_LeaderCreature = leader_creature.creature;
         }
     }
     NoDuplicate = data.no_duplicate;
 }