Exemple #1
0
    private void CreateFormationVariablesXml()
    {
        string UCB1XmlFilePath           = "Assets/XMLData/";
        string RegretMatchingXmlFilePath = "Assets/XMLData/";
        string formationVariablesPath    = "Assets/XMLData/";

        byte rows           = (byte)BoardData.Get().GetRows();
        byte columns        = (byte)BoardData.Get().GetColumns();
        byte maxUnitsInTeam = (byte)aiController.GetMaxUnitsInTeam();
        byte unitTypesCount = (byte)System.Enum.GetNames(typeof(UnitType)).Length;
        uint actionsCount   = aiController.GetPossibleActionsCount();

        UCB1XmlFilePath           += $"UCB1_{rows}x{columns}_{maxUnitsInTeam}_of_{unitTypesCount}_fake.xml";
        RegretMatchingXmlFilePath += $"RM_{rows}x{columns}_{maxUnitsInTeam}_of_{unitTypesCount}.xml";
        formationVariablesPath    += $"FormationVariables_{rows}x{columns}_{maxUnitsInTeam}_of_{unitTypesCount}.xml";

        formationVariablesXMLData = new XmlFormationVariables
                                    (
            rows,
            columns,
            maxUnitsInTeam,
            unitTypesCount,
            actionsCount,
            UCB1XmlFilePath,
            RegretMatchingXmlFilePath
                                    );

        XmlManaging.CreateFile <XmlFormationVariables>(formationVariablesXMLData, formationVariablesPath);
    }
Exemple #2
0
 private void ReadAlgorithimXml()
 {
     UtilityObjectData = XmlManaging.ReadFile <XmlUtilityObjectData>("Assets/XMLData/UCB1_2x4_2_of_4_fake.xml");
     aiController.GetTeamFormer().SetUtility(UtilityObjectData.CastToArrayOfArray());
 }
Exemple #3
0
 public void UpdateXmL()
 {
     XmlManaging.CreateFile <XmlUtilityObjectData>(UtilityObjectData, formationVariablesXMLData.UCB1ObjectDataPath);
 }