CPlayer.CPlayer C# (CSharp) Method

CPlayer() public method

public CPlayer ( byte player_index, PLAYER_TYPE player_type, SendFn send_function, CLocalServer, local_server ) : System
player_index byte
player_type PLAYER_TYPE
send_function SendFn
local_server CLocalServer,
return System
    public CPlayer(byte player_index, PLAYER_TYPE player_type, SendFn send_function, CLocalServer local_server)
    {
        this.player_index = player_index;
        this.agent = new CPlayerAgent(player_index);
        this.player_type = player_type;

        switch (this.player_type)
        {
            case PLAYER_TYPE.HUMAN:
                this.send_function = send_function;
                break;

            case PLAYER_TYPE.AI:
                this.ai_logic = new CAIPlayer(local_server);
                this.send_function = this.ai_logic.send;
                break;
        }
    }