Exemple #1
0
    private void Awake()
    {
        m_match = new Match();

        switch (m_matchControlType)
        {
        case MatchControlType.Local:
        {
            var userInput = new MouseAndKbInput();
            m_matchCtrl = new LocalMatchController(m_match, userInput);
            m_matchView.Init(m_match);
            break;
        }

        case MatchControlType.Client:
        {
            m_match.SetLogic(new ClientMatchLogic(m_match));
            m_matchCtrl = ClientBuilder.Create(m_match, m_matchView);
            break;
        }

        case MatchControlType.Server:
        {
            m_match.SetLogic(new ServerMatchLogic(m_match));
            m_matchCtrl = ServerBuilder.Create(m_match);
            m_matchView.Init(m_match);
            break;
        }
        }
    }
Exemple #2
0
    public static MatchController Create(Match match, MatchView matchView)
    {
        var userInput = new MouseAndKbInput();

        var ctrl = new ClientMatchController(match, userInput);

        matchView.Init(match);

        return(ctrl);
    }