/// <summary> /// Constructor from jsonobject /// </summary> /// <param name="js"></param> public Node(JSONObject js) { Nodes = new List<Node>(); //Debug.Log(Direction.stringToDirection(js.GetField(js.keys[0]).str)); _direction = Direction.stringToDirection(js.GetField(js.keys[0]).str); _nodeUsed = js.GetField(js.keys[1]).b; JSONObject array = js.GetField(js.keys[2]); //Debug.Log("nb sous node : " + array.Count); foreach (JSONObject node in array.list) { Node n = new Node(node); Nodes.Add(n); } }
public Character(int lifeMax, GameObject go) { _gameObject = GameObject.Instantiate(go); _gameObject.GetComponent<CharacterBehaviour>()._character = this; _gameObject.SetActive(false); Protections = new Dictionary<Element, int>(); ProtectionsNegative = new Dictionary<Element, int>(); /*GlobalProtection = 0; GlobalNegativeProtection = 0;*/ SommeProtection = 0; SommeNegativeProtection = 0; _lifeMax = lifeMax; _lifeCurrent = lifeMax; _rangeModifier = 0; DamageModifier = 0; HealModifier = 0; _globalShieldValue = 0; GlobalProtectionModifier = 0; _currentActionPoints = 1; _currentMovementPoints = 1; _turnNumber = 1; IsStabilized = false; foreach (var e in Element.GetElements()) { Protections[e] = 0; ProtectionsNegative[e] = 0; } _onTimeEffects = new Dictionary<int, PlayerOnTimeAppliedEffect>(); _effectsTerminable = new Dictionary<int, EffectTerminable>(); _onTimeEffectsToRemove = new List<int>(); CurrentState = State.Waiting; NextState = State.Waiting; _shields = new LinkedList<Shield>(); IdAreaAppliedThisTurn = new List<int>(); _direction = Direction.EnumDirection.DiagonalSouth; }
/// <summary> /// Constructor /// </summary> /// <param name="nodes"></param> /// <param name="direction"></param> public Node(Direction.EnumDirection direction, bool nodeUsed,List<Node> nodes) { Nodes = nodes; _direction = direction; _nodeUsed = nodeUsed; }