Beispiel #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));
 }
Beispiel #2
0
 public static bool HasConflict(EntController avatarCont)
 {
     foreach (BattleConflict conflict in _Conflicts) {
         if (conflict.HasAgitator(avatarCont)) {
             return true;
         }
     }
     return false;
 }
Beispiel #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");
            }
        }
Beispiel #4
0
 public void Awake()
 {
     _Controller = GetComponent<EntController>();
 }
Beispiel #5
0
 private static void Win(EntController winner)
 {
     if (Logging) {
         Debug.Log("------ winner: + " + winner.name + " ------");
     }
 }
Beispiel #6
0
 private static void Lose(EntController loser, EntController winner)
 {
     if (Logging) {
         Debug.Log("------ loser: + " + loser.name + " ------");
     }
 }
Beispiel #7
0
 private static void Draw(EntController stalemate)
 {
     if (Logging) {
         Debug.Log("------ stalemate: + " + stalemate.name + " ------");
     }
 }
 public BattleConflictAgitator(EntController agitator, EntUtils.ColliderType colliderType)
 {
     Controller = agitator;
     Behaviour = agitator.CurrentBehaviour;
     ColliderType = colliderType;
 }
Beispiel #9
0
 private int GetIndexFromAvatarController(EntController avatarCont)
 {
     return _Avatars.Values.ToArray().ToList().IndexOf(avatarCont);
 }
Beispiel #10
0
 public bool HasAgitator(EntController avatCont)
 {
     return
         _Pair.First.Controller == avatCont ||
         _Pair.Second.Controller == avatCont;
 }
Beispiel #11
0
 private void Start()
 {
     entController = GetComponent <EntController>();
     SetAttacks();
     BossStart();
 }