public BattleConflict(EntController contA, EntController contB, EntUtils.ColliderType typeA, EntUtils.ColliderType typeB) { _Pair = new BattleConflictPair( new BattleConflictAgitator(contA, typeA), new BattleConflictAgitator(contB, typeB)); }
public static bool HasConflict(EntController avatarCont) { foreach (BattleConflict conflict in _Conflicts) { if (conflict.HasAgitator(avatarCont)) { return true; } } return false; }
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"); } }
public void Awake() { _Controller = GetComponent<EntController>(); }
private static void Win(EntController winner) { if (Logging) { Debug.Log("------ winner: + " + winner.name + " ------"); } }
private static void Lose(EntController loser, EntController winner) { if (Logging) { Debug.Log("------ loser: + " + loser.name + " ------"); } }
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; }
private int GetIndexFromAvatarController(EntController avatarCont) { return _Avatars.Values.ToArray().ToList().IndexOf(avatarCont); }
public bool HasAgitator(EntController avatCont) { return _Pair.First.Controller == avatCont || _Pair.Second.Controller == avatCont; }
private void Start() { entController = GetComponent <EntController>(); SetAttacks(); BossStart(); }