private void checkConfigurationCardRemoveParts() { bool[] removeParts = CONFIGURATION_CARD.getRemoveParts(); for (int buttonIndex = 0; buttonIndex < removeParts.Length; ++buttonIndex) { if (removeParts[buttonIndex] && robotParts[buttonIndex] is Attachment) { bool canRemovePart = false; if (((Attachment)robotParts[buttonIndex]).isWeapon()) { for (int partIndex = 0; partIndex < robotParts.Count; ++partIndex) { if (robotParts[partIndex] is Attachment && robotParts[partIndex] != robotParts[buttonIndex] && ((Attachment)robotParts[partIndex]).isWeapon()) { canRemovePart = true; break; } } } else { canRemovePart = true; } if (canRemovePart) { robotParts.Remove(robotParts[buttonIndex]); } } } CONFIGURATION_CARD.resetRemoveParts(); if (removeParts.Length > robotParts.Count || humanParts.Count != INVENTORY_CARD.getHumanParts().Length) { CONFIGURATION_CARD.update(robotName, credits, robot.getDurability(), robot.getRemainingDurability(), robot.getRobotStatStrings(), robot.getWeight() > robot.getMaxForce(), robotParts.ToArray(), colorScheme, enableCreditsSpentAnimation); INVENTORY_CARD.update(credits, humanParts.ToArray(), robotParts.ToArray()); } }