예제 #1
0
 public BattleConflict(EntController contA,
         EntController contB,
         EntUtils.ColliderType typeA,
         EntUtils.ColliderType typeB)
 {
     _Pair = new BattleConflictPair(
             new BattleConflictAgitator(contA, typeA),
             new BattleConflictAgitator(contB, typeB));
 }
예제 #2
0
 public static bool HasConflict(EntController avatarCont)
 {
     foreach (BattleConflict conflict in _Conflicts) {
         if (conflict.HasAgitator(avatarCont)) {
             return true;
         }
     }
     return false;
 }
예제 #3
0
        public static void RegisterConflict(EntController contA,
                EntController contB,
                EntUtils.ColliderType typeA,
                EntUtils.ColliderType typeB)
        {
            if (Logging) {
                Debug.LogFormat("[CONFLICT] Attempt to register\n{0}{1}{2} ({3}{4}{5}) - {6}{7}{8} ({9}{10}{11})",
                        LOG_CONTROLLER_PREFIX, contA.name, LOG_CONTROLLER_SUFFIX,
                        LOG_BEHAVIOUR_PREFIX, typeA, LOG_BEHAVIOUR_SUFFIX,
                        LOG_CONTROLLER_PREFIX, contB.name, LOG_CONTROLLER_SUFFIX,
                        LOG_BEHAVIOUR_PREFIX, typeB, LOG_BEHAVIOUR_SUFFIX
                        );
            }

            BattleConflict conflict = new BattleConflict(contA, contB, typeA, typeB);
            if (!CollectionUtils.Contains(_Conflicts, conflict)) {
                _Conflicts.Add(new BattleConflict(contA, contB, typeA, typeB));
                if (Logging) {
                    Debug.Log("[CONFLICT] accepted count now " + _Conflicts.Count);
                }
            } else if (Logging) {
                Debug.Log("[CONFLICT] rejected");
            }
        }
예제 #4
0
 public void Awake()
 {
     _Controller = GetComponent<EntController>();
 }
예제 #5
0
 private static void Win(EntController winner)
 {
     if (Logging) {
         Debug.Log("------ winner: + " + winner.name + " ------");
     }
 }
예제 #6
0
 private static void Lose(EntController loser, EntController winner)
 {
     if (Logging) {
         Debug.Log("------ loser: + " + loser.name + " ------");
     }
 }
예제 #7
0
 private static void Draw(EntController stalemate)
 {
     if (Logging) {
         Debug.Log("------ stalemate: + " + stalemate.name + " ------");
     }
 }
예제 #8
0
 public BattleConflictAgitator(EntController agitator, EntUtils.ColliderType colliderType)
 {
     Controller = agitator;
     Behaviour = agitator.CurrentBehaviour;
     ColliderType = colliderType;
 }
예제 #9
0
 private int GetIndexFromAvatarController(EntController avatarCont)
 {
     return _Avatars.Values.ToArray().ToList().IndexOf(avatarCont);
 }
예제 #10
0
 public bool HasAgitator(EntController avatCont)
 {
     return
         _Pair.First.Controller == avatCont ||
         _Pair.Second.Controller == avatCont;
 }
예제 #11
0
 private void Start()
 {
     entController = GetComponent <EntController>();
     SetAttacks();
     BossStart();
 }