//Singleton implementation, returns or creates instance public static NetCons getInstance() { if (instance == null) { instance = new NetCons(); } return(instance); }
public Invite(String aliasA, String aliasB) { this.aliasA = aliasA; this.aliasB = aliasB; InitializeComponent(); //Set label message InviteLabel.Text = aliasA + " has invited you to a game! Accept or decline "; message = new MessageHandler(); network = NetCons.getInstance(); //Get NetCons instance }