internal ModPlayer CreateFor(Player newPlayer) { ModPlayer modPlayer = (ModPlayer)(CloneNewInstances ? MemberwiseClone() : Activator.CreateInstance(GetType())); modPlayer.Mod = Mod; modPlayer.player = newPlayer; modPlayer.index = index; modPlayer.Initialize(); return(modPlayer); }
internal static void SetupPlayer(Player player) { player.modPlayers.Clear(); foreach (ModPlayer modPlayer in players) { ModPlayer newPlayer = modPlayer.Clone(); newPlayer.player = player; newPlayer.Initialize(); player.modPlayers.Add(newPlayer); } }