コード例 #1
0
 public static Practica2.CharacterModel.Faction Faction(this Practica2.CharacterModel ch)
 {
     return(ch.color == Color.red ?
            Practica2.CharacterModel.Faction.Enemy :
            (ch.color == Color.blue ?
             Practica2.CharacterModel.Faction.Ally :
             Practica2.CharacterModel.Faction.Neutral));
 }
コード例 #2
0
 public static Practica2.CharacterModel.Health State(this Practica2.CharacterModel ch)
 {
     return(ch.hp > ch.maxHP * 0.9 ?
            Practica2.CharacterModel.Health.OK :
            (ch.hp > ch.maxHP * 0.1 ?
             Practica2.CharacterModel.Health.Damaged :
             Practica2.CharacterModel.Health.NearDeath));
 }
コード例 #3
0
 public static bool IsCritic(this Practica2.CharacterModel ch)
 {
     return(ch.hp < ch.maxHP * 0.1 ? true : false);
 }
コード例 #4
0
 public static bool IsOk(this Practica2.CharacterModel ch)
 {
     return(ch.hp > ch.maxHP * 0.9 ? true : false);
 }