private void SetOwnerOfIsland(Nation nation, int newOwnerIndex) { Nation newOwner = (Nation)nations[newOwnerIndex]; if (nation.islandWithin != -1 && nation.islandWithin != newOwnerIndex) { Nation owner = (Nation)nations[nation.islandWithin]; owner.ReleaseIsland(nation.playernr); newOwner.AddIsland(nation.playernr); } newOwner.UpdateIsland(nation.playernr, nation.GetPoints().ToArray(typeof(Vector2)) as Vector2[]); nation.island = true; nation.islandWithin = newOwnerIndex; }