Exemple #1
0
 public HumanPlayer(ECultures native)
 {
     Culture    = native;
     Pawns      = new List <APawn>();
     CultCenter = null;
     Cursor     = new Coord(1, 1);
 }
 private MonteCarloTreeSearch(ECultures cult)
 {
     GameTree   = new Node(0, null, null);
     Culture    = cult;
     Cursor     = new Coord(1, 1);
     Pawns      = new List <APawn>();
     CultCenter = null;
 }
Exemple #3
0
 public RandomPlayer(ECultures cult, Game curGame)
 {
     CurGame    = curGame;
     Culture    = cult;
     Pawns      = new List <APawn>();
     CultCenter = null;
     Cursor     = new Coord(1, 1);
 }
Exemple #4
0
 public Temple(ECultures culture)
 {
     Culture    = culture;
     CurrLife   = 0;
     TotalLife  = 0;
     Def        = 0;
     Position   = new Coord(0, 0);
     Size       = 2;
     LifePerSec = 0;
 }
 public MonteCarloTreeSearch(ECultures cult, ISelection selection, ISimulation simulation, Game game)
 {
     GameTree   = new Node(0, game.GetBoards(), null);
     CurGame    = game;
     Selection  = selection;
     Simulation = simulation;
     Expansion  = new ExpandAll();
     Culture    = cult;
     Cursor     = new Coord(1, 1);
     Pawns      = new List <APawn>();
     CultCenter = null;
 }
        public PawnsPerTerrain(ECultures cult)
        {
            Cult = cult;
            Array terrains = Enum.GetValues(typeof(ETerrain));

            PPTs = new Dictionary <ETerrain, int>();

            for (int i = 0; i < terrains.Length; i++)
            {
                PPTs.Add((ETerrain)terrains.GetValue(i), 0);
            }
        }
Exemple #7
0
 private void SetMeanEnemyDist(ECultures cult, double dist)
 {
     if (dist >= 0)
     {
         if (cult == ECultures.DALRIONS)
         {
             DalrionStatistcs[ENMY_DIST] = dist;
         }
         else
         {
             RahkarStatistcs[ENMY_DIST] = dist;
         }
     }
 }
Exemple #8
0
 private void SetMeanAllyDistance(ECultures cult, double dist)
 {
     if (dist >= 0)
     {
         if (cult == ECultures.DALRIONS)
         {
             DalrionStatistcs[ALLY_DIST] = dist;
         }
         else
         {
             RahkarStatistcs[ALLY_DIST] = dist;
         }
     }
 }
Exemple #9
0
 private void SetCenterRisk(ECultures cult, double risk)
 {
     if (risk >= 0)
     {
         if (cult == ECultures.DALRIONS)
         {
             DalrionStatistcs[CENTER_RISK] = risk;
         }
         else
         {
             RahkarStatistcs[CENTER_RISK] = risk;
         }
     }
 }
        public APawn Create(ECultures nature)
        {
            APawn pawn = null;

            switch (nature)
            {
            case ECultures.DALRIONS:
                return(new DalrionPawn());

            case ECultures.RAHKARS:
                return(new RahkarPawn());

            default:
                UserUtils.PrintError(nature + " isn't a valid culture!");
                Console.ReadLine();
                break;
            }
            return(pawn);
        }
 public CulturalCenter(ECultures native)
 {
     if (native == ECultures.DALRIONS)
     {
         BOARD_CHAR = BoardConsts.DALRION_CENTER;
     }
     else if (native == ECultures.RAHKARS)
     {
         BOARD_CHAR = BoardConsts.RAHKAR_CENTER;
     }
     Culture     = native;
     CurrLife    = 0;
     TotalLife   = 0;
     Def         = 0;
     LifePerSec  = 0;
     Position    = new Coord(0, 0);
     Size        = 5;
     UnitPerTurn = 10;
     SpawnPoint  = new Coord(0, 0);
     SpawnRange  = 4;
 }
        public ABuilding Create(ECultures native, Board boards)
        {
            CulturalCenter center = null;

            switch (native)
            {
            case ECultures.DALRIONS:
                center            = new CulturalCenter(ECultures.DALRIONS);
                center.TotalLife  = 100;
                center.CurrLife   = 100;
                center.Def        = 3;
                center.LifePerSec = 2;
                int dSize = center.Size / 2;
                center.Position = new Coord(1 + dSize, 1 + dSize);
                center.SetSpawnPoint(boards, new Coord(1, center.Position.Y + dSize + 2));
                break;

            case ECultures.RAHKARS:
                center            = new CulturalCenter(ECultures.RAHKARS);
                center.TotalLife  = 65;
                center.CurrLife   = 65;
                center.Def        = 4;
                center.LifePerSec = 1;
                int rSize = center.Size / 2;
                center.Position = new Coord(BoardConsts.MAX_LIN - rSize - 2, BoardConsts.MAX_COL - rSize - 2);
                center.SetSpawnPoint(boards, new Coord(BoardConsts.MAX_LIN - 1, center.Position.Y - rSize - 2));
                break;

            default:
                UserUtils.PrintError("Invalid culture. Can't create cultural center!");
                Console.ReadLine();
                break;
            }
            if (!Validate(center))
            {
                center = null;
            }
            return(center);
        }
Exemple #13
0
 public void SetCulture(ECultures cult)
 {
     Culture = cult;
 }