Linq課題1


課題
GetMaxAtk関数に処理を追記して、仕様を満たすようにしてください。(Linqを使うこと)

using UnityEngine;
using System;
using System.Collections.Generic;

public class StudyLinq : MonoBehaviour
{

    public List<Character> charaList = new List<Character> ();

    void Start ()
    {
        charaList.Add (new Character () { m_hp = 100, m_atk = 20, m_name = "太郎", m_isDead = false });
        charaList.Add (new Character () { m_hp = 344, m_atk = 50, m_name = "花子", m_isDead = false });
        charaList.Add (new Character () { m_hp = 288, m_atk = 70, m_name = "ぼっちゃん", m_isDead = false });
        charaList.Add (new Character () { m_hp = 399, m_atk = 80, m_name = "ジョブス", m_isDead = true });

        var result = GetMaxAtk (charaList);
        Debug.Log (result);

    }

    /// <summary>
    /// 生き残っているキャラの中で一番HPが高い奴の攻撃力のを返す関数
    /// </summary>
    int GetMaxAtk (List<Character> list)
    {
        return -1;
    }
}

[Serializable]
public class Character
{
    public int m_hp;
    public int m_atk;
    public string m_name;
    public bool m_isDead;

}