| 1 |  |  | /* | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  |  * This file is part of Araknemu. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  * Araknemu is free software: you can redistribute it and/or modify | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  |  * it under the terms of the GNU Lesser General Public License as published by | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  |  * the Free Software Foundation, either version 3 of the License, or | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  |  * (at your option) any later version. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  |  * Araknemu is distributed in the hope that it will be useful, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  |  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  |  * GNU Lesser General Public License for more details. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  |  * You should have received a copy of the GNU Lesser General Public License | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  |  * along with Araknemu.  If not, see <https://www.gnu.org/licenses/>. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 16 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 17 |  |  |  * Copyright (c) 2017-2019 Vincent Quatrevieux | 
            
                                                                                                            
                            
            
                                    
            
            
                | 18 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 19 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 20 |  |  | package fr.quatrevieux.araknemu.game.fight.castable.effect.buff; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 21 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  | import fr.quatrevieux.araknemu.game.fight.castable.CastScope; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  | import fr.quatrevieux.araknemu.game.fight.castable.effect.EffectValue; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  | import fr.quatrevieux.araknemu.game.fight.castable.effect.handler.damage.Damage; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 |  |  | import fr.quatrevieux.araknemu.game.fight.castable.effect.handler.damage.ReflectedDamage; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  | import fr.quatrevieux.araknemu.game.fight.fighter.ActiveFighter; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  | import fr.quatrevieux.araknemu.game.fight.fighter.Fighter; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 |  |  | import fr.quatrevieux.araknemu.game.fight.fighter.PassiveFighter; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 |  |  | import fr.quatrevieux.araknemu.game.fight.turn.Turn; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 |  |  | import fr.quatrevieux.araknemu.network.game.out.fight.AddBuff; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 31 |  |  | import fr.quatrevieux.araknemu.util.SafeLinkedList; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 32 |  |  | import org.checkerframework.checker.index.qual.Positive; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 33 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 34 |  |  | import java.util.Iterator; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 35 |  |  | import java.util.function.Predicate; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  | import java.util.stream.Stream; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 |  |  | import java.util.stream.StreamSupport; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 38 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 39 |  |  | /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 40 |  |  |  * Handle buff list for a fighter | 
            
                                                                                                            
                            
            
                                    
            
            
                | 41 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 42 |  |  | public final class BuffList implements Iterable<Buff>, Buffs { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 43 |  |  |     private final Fighter fighter; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 44 | 1 |  |     private final SafeLinkedList<Buff> buffs = new SafeLinkedList<>(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 46 | 1 |  |     public BuffList(Fighter fighter) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 47 | 1 |  |         this.fighter = fighter; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 48 | 1 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 49 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 50 |  |  |     @Override | 
            
                                                                                                            
                            
            
                                    
            
            
                | 51 |  |  |     public Iterator<Buff> iterator() { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 52 | 1 |  |         return buffs.iterator(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 53 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 54 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 55 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 56 |  |  |      * Get the Buff stream | 
            
                                                                                                            
                            
            
                                    
            
            
                | 57 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 58 |  |  |     public Stream<Buff> stream() { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 59 | 1 |  |         return StreamSupport.stream(spliterator(), false); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 60 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 61 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 62 |  |  |     @Override | 
            
                                                                                                            
                            
            
                                    
            
            
                | 63 |  |  |     public void add(Buff buff) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 64 | 1 |  |         buffs.add(buff); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 65 | 1 |  |         buff.hook().onBuffStarted(buff); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 66 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 67 | 1 |  |         if (buff.remainingTurns() == 0) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 68 | 1 |  |             buff.incrementRemainingTurns(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 69 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 70 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 71 | 1 |  |         fighter.fight().send(new AddBuff(buff)); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 72 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 73 |  |  |         // Add one turn when it's the turn of the current fighter | 
            
                                                                                                            
                            
            
                                    
            
            
                | 74 | 1 |  |         if (fighter.isPlaying()) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 75 | 1 |  |             buff.incrementRemainingTurns(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 76 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 77 | 1 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 78 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 79 |  |  |     @Override | 
            
                                                                                                            
                            
            
                                    
            
            
                | 80 |  |  |     public boolean onStartTurn() { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 81 | 1 |  |         boolean result = true; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 82 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 83 | 1 |  |         for (Buff buff : buffs) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 84 | 1 |  |             result &= buff.hook().onStartTurn(buff); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 85 | 1 |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 86 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 87 | 1 |  |         return result; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 88 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 89 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 90 |  |  |     @Override | 
            
                                                                                                            
                            
            
                                    
            
            
                | 91 |  |  |     public void onEndTurn(Turn turn) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 92 | 1 |  |         for (Buff buff : buffs) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 93 | 1 |  |             buff.hook().onEndTurn(buff, turn); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 94 | 1 |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 95 | 1 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 96 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 97 |  |  |     @Override | 
            
                                                                                                            
                            
            
                                    
            
            
                | 98 |  |  |     public void onCast(CastScope cast) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 99 | 1 |  |         for (Buff buff : buffs) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 100 | 1 |  |             buff.hook().onCast(buff, cast); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 101 | 1 |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 102 | 1 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 103 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 104 |  |  |     @Override | 
            
                                                                                                            
                            
            
                                    
            
            
                | 105 |  |  |     public boolean onCastTarget(CastScope cast) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 106 | 1 |  |         for (Buff buff : buffs) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 107 | 1 |  |             if (!buff.hook().onCastTarget(buff, cast)) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 108 | 1 |  |                 return false; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 109 |  |  |             } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 110 | 1 |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 111 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 112 | 1 |  |         return true; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 113 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 114 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 115 |  |  |     @Override | 
            
                                                                                                            
                            
            
                                    
            
            
                | 116 |  |  |     public void onDirectDamage(ActiveFighter caster, Damage value) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 117 | 1 |  |         for (Buff buff : buffs) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 118 | 1 |  |             buff.hook().onDirectDamage(buff, caster, value); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 119 | 1 |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 120 | 1 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 121 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 122 |  |  |     @Override | 
            
                                                                                                            
                            
            
                                    
            
            
                | 123 |  |  |     public void onIndirectDamage(ActiveFighter caster, Damage value) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 124 | 1 |  |         for (Buff buff : buffs) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 125 | 1 |  |             buff.hook().onIndirectDamage(buff, caster, value); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 126 | 1 |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 127 | 1 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 128 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 129 |  |  |     @Override | 
            
                                                                                                            
                            
            
                                    
            
            
                | 130 |  |  |     public void onBuffDamage(Buff poison, Damage value) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 131 | 1 |  |         for (Buff buff : buffs) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 132 | 1 |  |             buff.hook().onBuffDamage(buff, poison, value); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 133 | 1 |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 134 | 1 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 135 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 136 |  |  |     @Override | 
            
                                                                                                            
                            
            
                                    
            
            
                | 137 |  |  |     public void onDirectDamageApplied(ActiveFighter caster, @Positive int value) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 138 | 1 |  |         for (Buff buff : buffs) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 139 | 1 |  |             buff.hook().onDirectDamageApplied(buff, caster, value); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 140 | 1 |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 141 | 1 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 142 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 143 |  |  |     @Override | 
            
                                                                                                            
                            
            
                                    
            
            
                | 144 |  |  |     public void onLifeAltered(int value) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 145 | 1 |  |         for (Buff buff : buffs) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 146 | 1 |  |             buff.hook().onLifeAltered(buff, value); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 147 | 1 |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 148 | 1 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 149 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 150 |  |  |     @Override | 
            
                                                                                                            
                            
            
                                    
            
            
                | 151 |  |  |     public void onReflectedDamage(ReflectedDamage damage) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 152 | 1 |  |         for (Buff buff : buffs) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 153 | 1 |  |             buff.hook().onReflectedDamage(buff, damage); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 154 | 1 |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 155 | 1 |  |     } | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 156 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 157 |  |  |     @Override | 
            
                                                                        
                            
            
                                    
            
            
                | 158 |  |  |     public void onCastDamage(Damage damage, PassiveFighter target) { | 
            
                                                                        
                            
            
                                    
            
            
                | 159 | 1 |  |         for (Buff buff : buffs) { | 
            
                                                                        
                            
            
                                    
            
            
                | 160 | 1 |  |             buff.hook().onCastDamage(buff, damage, target); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 161 | 1 |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 162 | 1 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 163 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 164 |  |  |     @Override | 
            
                                                                                                            
                            
            
                                    
            
            
                | 165 |  |  |     public void onEffectValueCast(EffectValue value) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 166 | 1 |  |         for (Buff buff : buffs) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 167 | 1 |  |             buff.hook().onEffectValueCast(buff, value); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 168 | 1 |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 169 | 1 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 170 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 171 |  |  |     @Override | 
            
                                                                                                            
                            
            
                                    
            
            
                | 172 |  |  |     public void onEffectValueTarget(EffectValue value, PassiveFighter caster) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 173 | 1 |  |         for (Buff buff : buffs) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 174 | 1 |  |             buff.hook().onEffectValueTarget(buff, value, caster); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 175 | 1 |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 176 | 1 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 177 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 178 |  |  |     @Override | 
            
                                                                                                            
                            
            
                                    
            
            
                | 179 |  |  |     public void refresh() { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 180 |  |  |         // invalidate buffs before removing it in case of buffs are iterated by onBuffTerminated() hook | 
            
                                                                                                            
                            
            
                                    
            
            
                | 181 | 1 |  |         buffs.forEach(Buff::decrementRemainingTurns); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 182 | 1 |  |         removeIf(buff -> !buff.valid()); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 183 | 1 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 184 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 185 |  |  |     @Override | 
            
                                                                                                            
                            
            
                                    
            
            
                | 186 |  |  |     public boolean removeAll() { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 187 | 1 |  |         return removeIf(Buff::canBeDispelled); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 188 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 189 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 190 |  |  |     @Override | 
            
                                                                                                            
                            
            
                                    
            
            
                | 191 |  |  |     public boolean removeByCaster(PassiveFighter caster) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 192 | 1 |  |         return removeIf(buff -> buff.caster().equals(caster)); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 193 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 194 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 195 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 196 |  |  |      * Remove buff by a predicate | 
            
                                                                                                            
                            
            
                                    
            
            
                | 197 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 198 |  |  |      * @param predicate Takes the buff as parameter, and return true to delete (and terminate) the buff | 
            
                                                                                                            
                            
            
                                    
            
            
                | 199 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 200 |  |  |      * @return true if there is a change (i.e. a buff is terminated) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 201 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 202 |  |  |     private boolean removeIf(Predicate<Buff> predicate) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 203 | 1 |  |         final Iterator<Buff> iterator = buffs.iterator(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 204 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 205 | 1 |  |         boolean hasChanged = false; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 206 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 207 | 1 |  |         while (iterator.hasNext()) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 208 | 1 |  |             final Buff buff = iterator.next(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 209 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 210 | 1 |  |             if (predicate.test(buff)) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 211 | 1 |  |                 iterator.remove(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 212 | 1 |  |                 buff.hook().onBuffTerminated(buff); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 213 | 1 |  |                 hasChanged = true; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 214 |  |  |             } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 215 | 1 |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 216 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 217 | 1 |  |         return hasChanged; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 218 |  |  |     } | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 219 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 220 |  |  |  |