Esempio n. 1
0
        private void InitializeAgentSelectionComboBox()
        {
            AgentDict dict = new AgentDict();

            AgentSelectComboBox.Items.AddRange(dict.AgentDictionary.Keys.ToArray());
            AgentSelectComboBox.SelectedIndex = 0;
        }
Esempio n. 2
0
        private void InitializeMinMaxSelectionComboBox()
        {
            AgentDict dict = new AgentDict();

            MinMaxAgentComboBox.Items.AddRange(dict.AgentDictionary.Keys.ToArray());
            MinMaxAgentComboBox.Items.Remove(typeof(MinMaxAgent).Name);
            MinMaxAgentComboBox.Items.Remove(typeof(RandomAgent).Name);
            MinMaxAgentComboBox.SelectedIndex = 0;
        }
Esempio n. 3
0
        private IOthelloAgent GetAgent()
        {
            AgentDict dict = new AgentDict();
            Type      agentType;

            dict.AgentDictionary.TryGetValue(AgentSelectComboBox.SelectedItem.ToString(), out agentType);
            IOthelloAgent agent;

            if (agentType == typeof(MinMaxAgent))
            {
                Type subAgentType;
                dict.AgentDictionary.TryGetValue(MinMaxAgentComboBox.SelectedItem.ToString(), out subAgentType);
                agent = new MinMaxAgent((IEvaluationAgent)Activator.CreateInstance(subAgentType));
            }
            else
            {
                agent = (IOthelloAgent)Activator.CreateInstance(agentType);
            }
            return(agent);
        }