예제 #1
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="endOfRevolution">The <see cref="EndOfRevolution"/> value.</param>
 /// <param name="endOfProduction">The <see cref="EndOfProduction"/> value.</param>
 /// <param name="endOfAdvance">The <see cref="EndOfAdvance"/> value.</param>
 /// <param name="showEndOfAdvance">The <see cref="ShowEndOfAdvance"/> value.</param>
 internal TurnConsequencesPivot(bool endOfRevolution, Dictionary <CityPivot, BuildablePivot> endOfProduction, AdvancePivot endOfAdvance, bool showEndOfAdvance)
 {
     EndOfRevolution  = endOfRevolution;
     EndOfProduction  = endOfProduction;
     EndOfAdvance     = endOfAdvance;
     ShowEndOfAdvance = showEndOfAdvance;
 }
예제 #2
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="city">The <see cref="UnitPivot.City"/> value.</param>
 /// <param name="defensePoints">The <see cref="UnitPivot.DefensePoints"/> value.</param>
 /// <param name="offensePoints">The <see cref="UnitPivot.OffensePoints"/> value.</param>
 /// <param name="speed">The <see cref="UnitPivot.Speed"/> value.</param>
 /// <param name="productivityCost">The <see cref="BuildablePivot.ProductivityCost"/> value.</param>
 /// <param name="advancePrerequisite">The <see cref="BuildablePivot.AdvancePrerequisite"/> value.</param>
 /// <param name="advanceObsolescence">The <see cref="BuildablePivot.AdvanceObsolescence"/> value.</param>
 /// <param name="purchasePrice">The <see cref="BuildablePivot.PurchasePrice"/> value.</param>
 /// <param name="name">The <see cref="BuildablePivot.Name"/> value.</param>
 /// <param name="citizenCostToProduce">The <see cref="UnitPivot.CitizenCostToProduce"/> value.</param>
 /// <param name="location">The <see cref="UnitPivot.MapSquareLocation"/> value, if <paramref name="city"/> is <c>Null</c>.</param>
 /// <param name="player">The <see cref="UnitPivot.Player"/> value, if <paramref name="city"/> is <c>Null</c>.</param>
 /// <param name="ignoreControlZone">Optional; the <see cref="UnitPivot.IgnoreControlZone"/> value.</param>
 /// <param name="ignoreCityWalls">Optional; the <see cref="UnitPivot.IgnoreCityWalls"/> value.</param>
 /// <param name="maintenanceCost">Optional; the <see cref="UnitPivot.MaintenanceCost"/> value.</param>
 protected LandUnitPivot(CityPivot city, int offensePoints, int defensePoints, int speed, int productivityCost,
                         AdvancePivot advancePrerequisite, AdvancePivot advanceObsolescence, int purchasePrice, string name, int citizenCostToProduce,
                         MapSquarePivot location, PlayerPivot player, bool ignoreControlZone = false, bool ignoreCityWalls = false, int maintenanceCost = 1) :
     base(city, offensePoints, defensePoints, speed, productivityCost, advancePrerequisite, advanceObsolescence,
          purchasePrice, name, citizenCostToProduce, location, player, ignoreControlZone, ignoreCityWalls, 1, maintenanceCost)
 {
 }
예제 #3
0
        /// <summary>
        /// Changes the <see cref="AdvancePivot"/> in progress.
        /// </summary>
        /// <param name="advance">The new advance.</param>
        /// <returns><c>True</c> if success; <c>False</c> otherwise.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="advance"/> is <c>Null</c>.</exception>
        public bool ChangeCurrentAdvance(AdvancePivot advance)
        {
            if (advance == null)
            {
                throw new ArgumentNullException(nameof(advance));
            }

            return(HumanPlayer.ChangeCurrentAdvance(advance));
        }
예제 #4
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="city">The <see cref="UnitPivot.City"/> value.</param>
 /// <param name="defensePoints">The <see cref="UnitPivot.DefensePoints"/> value.</param>
 /// <param name="offensePoints">The <see cref="UnitPivot.OffensePoints"/> value.</param>
 /// <param name="speed">The <see cref="UnitPivot.Speed"/> value.</param>
 /// <param name="productivityCost">The <see cref="BuildablePivot.ProductivityCost"/> value.</param>
 /// <param name="advancePrerequisite">The <see cref="BuildablePivot.AdvancePrerequisite"/> value.</param>
 /// <param name="advanceObsolescence">The <see cref="BuildablePivot.AdvanceObsolescence"/> value.</param>
 /// <param name="purchasePrice">The <see cref="BuildablePivot.PurchasePrice"/> value.</param>
 /// <param name="name">The <see cref="BuildablePivot.Name"/> value.</param>
 /// <param name="location">The <see cref="UnitPivot.MapSquareLocation"/> value, if <paramref name="city"/> is <c>Null</c>.</param>
 /// <param name="player">The <see cref="UnitPivot.Player"/> value, if <paramref name="city"/> is <c>Null</c>.</param>
 /// <param name="ignoreControlZone">Optional; the <see cref="UnitPivot.IgnoreControlZone"/> value.</param>
 /// <param name="ignoreCityWalls">Optional; the <see cref="UnitPivot.IgnoreCityWalls"/> value.</param>
 /// <param name="squareSight">Optional; the <see cref="UnitPivot.SquareSight"/> value.</param>
 /// <param name="transportCapacity">Optional; the <see cref="TransportCapacity"/> value.</param>
 /// <param name="canAttackCoastUnit">Optional; the <see cref="CanAttackCoastUnit"/> value.</param>
 /// <param name="maintenanceCost">The <see cref="UnitPivot.MaintenanceCost"/> value.</param>
 protected SeaUnitPivot(CityPivot city, int offensePoints, int defensePoints, int speed, int productivityCost,
                        AdvancePivot advancePrerequisite, AdvancePivot advanceObsolescence, int purchasePrice, string name, MapSquarePivot location,
                        PlayerPivot player, bool ignoreControlZone, bool ignoreCityWalls, int squareSight, int transportCapacity, bool canAttackCoastUnit, int maintenanceCost) :
     base(city, offensePoints, defensePoints, speed, productivityCost, advancePrerequisite, advanceObsolescence, purchasePrice, name, 0,
          location, player, ignoreControlZone, ignoreCityWalls, squareSight, maintenanceCost)
 {
     TransportCapacity  = transportCapacity;
     CanAttackCoastUnit = canAttackCoastUnit;
 }
예제 #5
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="productivityCost">The <see cref="ProductivityCost"/> value.</param>
 /// <param name="advancePrerequisite">The <see cref="AdvancePrerequisite"/> value.</param>
 /// <param name="advanceObsolescence">The <see cref="AdvanceObsolescence"/> value.</param>
 /// <param name="purchasePrice">The <see cref="PurchasePrice"/> value.</param>
 /// <param name="name">The <see cref="Name"/> value.
 /// IF <c>Null</c>, the class name is used without the "Pivot" suffix.</param>
 /// <param name="hasCitizenHappinessEffect">The <see cref="HasCitizenHappinessEffect"/> value.</param>
 protected BuildablePivot(int productivityCost, AdvancePivot advancePrerequisite, AdvancePivot advanceObsolescence,
                          int purchasePrice, string name, bool hasCitizenHappinessEffect)
 {
     Name                      = name ?? GetType().Name.Replace("Pivot", string.Empty);
     ProductivityCost          = productivityCost;
     HasCitizenHappinessEffect = hasCitizenHappinessEffect;
     AdvancePrerequisite       = advancePrerequisite;
     AdvanceObsolescence       = advanceObsolescence;
     PurchasePrice             = purchasePrice;
 }
예제 #6
0
 private void ShowNewAdvanceDiscovered(AdvancePivot advance, bool getNewOne, bool showCurrentOne)
 {
     if (showCurrentOne)
     {
         MessageBox.Show($"New scientific advance : {advance.Name} !", "ErsatzCiv");
     }
     if (getNewOne)
     {
         new WindowAdvancePick(_engine).ShowDialog();
     }
 }
예제 #7
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="city">The <see cref="City"/> value.</param>
 /// <param name="defensePoints">The <see cref="DefensePoints"/> value.</param>
 /// <param name="offensePoints">The <see cref="OffensePoints"/> value.</param>
 /// <param name="speed">The <see cref="Speed"/> value.</param>
 /// <param name="productivityCost">The <see cref="BuildablePivot.ProductivityCost"/> value.</param>
 /// <param name="advancePrerequisite">The <see cref="BuildablePivot.AdvancePrerequisite"/> value.</param>
 /// <param name="advanceObsolescence">The <see cref="BuildablePivot.AdvanceObsolescence"/> value.</param>
 /// <param name="purchasePrice">The <see cref="BuildablePivot.PurchasePrice"/> value.</param>
 /// <param name="name">The <see cref="BuildablePivot.Name"/> value.</param>
 /// <param name="citizenCostToProduce">The <see cref="CitizenCostToProduce"/> value.</param>
 /// <param name="location">The <see cref="MapSquareLocation"/> value, if <paramref name="city"/> is <c>Null</c>.</param>
 /// <param name="player">The <see cref="Player"/> value, if <paramref name="city"/> is <c>Null</c>.</param>
 /// <param name="ignoreControlZone">The <see cref="IgnoreControlZone"/> value.</param>
 /// <param name="ignoreCityWalls">The <see cref="IgnoreCityWalls"/> value.</param>
 /// <param name="squareSight">The <see cref="SquareSight"/> value.</param>
 /// <param name="maintenanceCost">The <see cref="MaintenanceCost"/> value.</param>
 protected UnitPivot(CityPivot city, int offensePoints, int defensePoints, int speed, int productivityCost, AdvancePivot advancePrerequisite,
                     AdvancePivot advanceObsolescence, int purchasePrice, string name, int citizenCostToProduce, MapSquarePivot location, PlayerPivot player,
                     bool ignoreControlZone, bool ignoreCityWalls, int squareSight, int maintenanceCost) :
     base(productivityCost, advancePrerequisite, advanceObsolescence, purchasePrice, name, false)
 {
     Player               = city?.Player ?? player;
     City                 = city;
     MapSquareLocation    = city?.MapSquareLocation ?? location;
     DefensePoints        = defensePoints;
     OffensePoints        = offensePoints;
     Speed                = speed;
     RemainingMoves       = ComputeRealSpeed();
     CitizenCostToProduce = citizenCostToProduce;
     IgnoreControlZone    = ignoreControlZone;
     IgnoreCityWalls      = ignoreCityWalls;
     SquareSight          = squareSight;
     MaintenanceCost      = maintenanceCost;
 }
예제 #8
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="advance">The <see cref="Advance"/> value.</param>
 /// <param name="wasInProgressAdvance">The <see cref="WasInProgressAdvance"/> value.</param>
 internal ForcedAdvanceEventArgs(AdvancePivot advance, bool wasInProgressAdvance)
 {
     Advance = advance;
     WasInProgressAdvance = wasInProgressAdvance;
 }
예제 #9
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="productivityCost">The <see cref="BuildablePivot.ProductivityCost"/> value.</param>
 /// <param name="advancePrerequisite">The <see cref="BuildablePivot.AdvancePrerequisite"/> value.</param>
 /// <param name="purchasePrice">The <see cref="BuildablePivot.PurchasePrice"/> value.</param>
 /// <param name="name">Optionnal; the <see cref="BuildablePivot.Name"/> value.</param>
 /// <param name="spaceShipItemCount">Optionnal; the <see cref="SpaceShipItemCount"/> value.</param>
 protected SpaceShipPivot(int productivityCost, AdvancePivot advancePrerequisite,
                          int purchasePrice, string name, int spaceShipItemCount) :
     base(productivityCost, advancePrerequisite, null, purchasePrice, name, false)
 {
     SpaceShipItemCount = spaceShipItemCount;
 }