var myRoom = Octgn.Play.Octgn.GetRoom(); // get the current game room var player = myRoom.Players.Find(p => p.Name == "John"); // search for player named John if (player != null) { // do something with the player }
var myRoom = Octgn.Play.Octgn.GetRoom(); // get the current game room var playerList = myRoom.Players.FindAll(p => p.IsSpectator == false); // get a list of non-spectator players foreach (var player in playerList) { // do something with each player that is not a spectator }In this example, we retrieve the current game room and then use the Player FindAll method to get a list of players who are not spectators. We can then loop through each player in the list and take certain actions. Overall, the Octgn.Play package library is designed for building game applications and provides a range of functionality for game developers. The Player Find method is just one example of the many useful features included in this package.