Exemple #1
0
        public Player(String name, Color color, IComponentAI componentAI, int orderID, int[][] personality, bool gen)
        {
            this.orderID = orderID;
            this.gen = gen;
            points = new int[(int) PlayerPoints.Count];
            prevSource = new SourceAll(0);
            source = new SourceAll(0);
            transactionSource = new SourceAll(0);
            sumSpentSources = new SourceAll(0);

            ClearCollectSources();
            collectSourcesNormal = new SourceAll(0);

            buildingCount = new int[(int) Building.Count];
            for (int loop1 = 0; loop1 < (int)Building.Count; loop1++)
            {
                buildingCount[loop1] = 0;
            }

            licenceMarket = new LicenceKind[(int)SourceKind.Count];
            for (int loop1 = 0; loop1 < (int)SourceBuildingKind.Count; loop1++)
            {
                licenceMarket[loop1] = LicenceKind.NoLicence;
            }

            upgradeMonastery = new UpgradeKind[(int) SourceBuildingKind.Count];
            for (int loop1 = 0; loop1 < (int)SourceBuildingKind.Count; loop1++)
            {
                upgradeMonastery[loop1] = UpgradeKind.NoUpgrade;
            }

            this.color = color;
            this.name = name;
            this.componentAI = componentAI;
            this.personality = personality;

            materialChanged = false;
            active = true;

            monastery = new List<IMonastery>();
            market = new List<IMarket>();
            fort = new List<IFort>();
            town = new List<ITown>();
            road = new List<IRoad>();

            statistic = new Statistic();
        }
Exemple #2
0
 private static void AIThread(IComponentAI ai)
 {
     try
     {
         ai.ResolveAI();
     } 
     catch (Exception exception)
     {
         Player player = GameMaster.Inst().GetActivePlayer();
         player.SetActive(false);
         String log = exception.Message + " : from : " + exception.Source + System.Environment.NewLine +
                      exception.HelpLink + System.Environment.NewLine +
                      exception.StackTrace + System.Environment.NewLine +
                      exception.TargetSite + System.Environment.NewLine +
                      exception.InnerException;
         Logger.Inst().Log(ai.GetAIName() + " - " + player.GetName() + ".txt", log);
     }
 }
Exemple #3
0
 public Player(String name, Color color, IComponentAI componentAI, int orderID)
     : this(name, color, componentAI, orderID, null, false)
 {
 }