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;
}
Author And Source
この問題について(Linq課題1), 我々は、より多くの情報をここで見つけました https://qiita.com/ShirakawaMaru/items/2304099e2893bf69e9a7著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .