public List <string> equals(SlottableAnatomy other_anatomy) { List <string> mismatch = new List <string>(); foreach (KeyValuePair <string, EquipData> a in anatomy) { EquipData mine = a.Value; EquipData other = other_anatomy.anatomy[a.Key]; if (mine == null && other == null) { continue; } if (mine == null && other != null || mine != null && other == null || mine.key != other.key) { mismatch.Add(a.Key); } } foreach (KeyValuePair <string, List <EquipData> > multi in multis) { List <EquipData> mine = multi.Value; List <EquipData> other = other_anatomy.multis[multi.Key]; if (mine.Count != other.Count) { mismatch.Add(multi.Key); break; } List <string> my_names = new List <string>(); List <string> other_names = new List <string>(); foreach (EquipData x in mine) { my_names.Add(x.key); } foreach (EquipData x in other) { other_names.Add(x.key); } my_names.Sort(); other_names.Sort(); for (int i = 0; i < mine.Count; i++) { if (my_names[i] != other_names[i]) { mismatch.Add(multi.Key); break; } } } return(mismatch); }
// Use this for initialization void Start() { actor = GetComponent <UnitActor>(); equips_loader = GetComponent <EquipsLoader>(); anatomy = actor.anatomy; //GetComponent<SlottableAnatomy>(); validator = GameObject.Find("Validator").GetComponent <SlottableAnatomy>(); begin_test(); print_test_result(); }
// Use this for initialization void Start() { hex_tile = GetComponentInParent <HexCoord>(); tactical_map = GameObject.FindObjectOfType <TacticalMap>(); apc_attack = 50; turn_ending_attack = true; initialize_tooltip_dictionary(); initialize_confirmation_dictionary(); anatomy = GetComponent <SlottableAnatomy>(); actor_techs = GetComponent <ActorTechs>(); action_controller = GetComponent <ActionController>(); stats = GetComponent <Stats>(); interaction = GetComponent <Interaction>(); anatomy.set_parent_actor(this); action_controller.set_parent_actor(this); stats.set_parent_actor(this); interaction.set_parent_actor(this); }