public void OnEvent(EventData photonEvent)
        {
            byte eventCode = photonEvent.Code;

            switch (eventCode)
            {
            case SendNewActivityLineCode:
                object[] arr = (object[])photonEvent.CustomData;
                ReceiveActivityMessage(arr);
                break;

            case PlayerTurnCode:
                currentPlayer = (int)photonEvent.CustomData;
                StartTurn();
                break;

            case ReceiveMoneyCode:
                int amount = (int)photonEvent.CustomData;
                PlayerManager.balance += amount;
                break;

            case PropertyChangeCode:
                object[] data     = (object[])photonEvent.CustomData;
                int      location = (int)data[0];
                string   property = (string)data[1];

                if (board.locations[location] is Utility)
                {
                    Utility temp = (Utility)board.locations[location];
                    if (property == "owner")
                    {
                        if (data[2] == null)
                        {
                            temp.owner = null;
                        }
                        else
                        {
                            temp.owner = players[(int)data[2]];
                        }
                    }
                    board.locations[location] = temp;
                }
                else if (board.locations[location] is Railroad)
                {
                    Railroad temp = (Railroad)board.locations[location];
                    if (property == "owner")
                    {
                        if (data[2] == null)
                        {
                            temp.owner = null;
                        }
                        else
                        {
                            temp.owner = players[(int)data[2]];
                        }
                    }
                    board.locations[location] = temp;
                }
                else if (board.locations[location] is Property)
                {
                    Property temp = (Property)board.locations[location];
                    if (property == "owner")
                    {
                        if (data[2] == null)
                        {
                            temp.owner = null;
                        }
                        else
                        {
                            temp.owner = players[(int)data[2]];
                        }
                        board.locations[location] = temp;
                    }
                    else if (property == "buildHouse")
                    {
                        temp.BuildHouse();
                    }
                    else if (property == "reset")
                    {
                        temp.Reset();
                    }
                    board.locations[location] = temp;
                }
                break;

            case EndGameCode:
                int?playerNum = (int?)photonEvent.CustomData;
                if (playerNum == null)
                {
                    EndGame(null);
                }
                else
                {
                    EndGame(players[(int)playerNum], true);
                }
                break;

            case CardCode:
                string[] data2 = (string[])photonEvent.CustomData;
                cardWindow.DisplayCard(data2[0], data2[1]);
                break;
            }
        }