Exemple #1
0
 public CrewMember(CrewMember baseCrewMember)
 {
     _id          = baseCrewMember.Id;
     Pilot        = baseCrewMember.Pilot;
     Fighter      = baseCrewMember.Fighter;
     Trader       = baseCrewMember.Trader;
     Engineer     = baseCrewMember.Engineer;
     _curSystemId = baseCrewMember.CurrentSystemId;
 }
 public CrewMember(CrewMemberId id, int pilot, int fighter, int trader, int engineer, StarSystemId curSystemId)
 {
     Id = id;
     Pilot = pilot;
     Fighter = fighter;
     Trader = trader;
     Engineer = engineer;
     CurrentSystemId = curSystemId;
 }
Exemple #3
0
 public CrewMember(CrewMemberId id, int pilot, int fighter, int trader, int engineer, StarSystemId curSystemId)
 {
     _id          = id;
     Pilot        = pilot;
     Fighter      = fighter;
     Trader       = trader;
     Engineer     = engineer;
     _curSystemId = curSystemId;
 }
Exemple #4
0
        public StarSystem(StarSystemId id, int x, int y, Size size, TechLevel techLevel,
                          PoliticalSystemType politicalSystemType, SystemPressure systemPressure, SpecialResource specialResource)
        {
            _id                  = id;
            _x                   = x;
            _y                   = y;
            _size                = size;
            _techLevel           = techLevel;
            _politicalSystemType = politicalSystemType;
            _systemPressure      = systemPressure;
            _specialResource     = specialResource;

            InitializeTradeItems();
        }
Exemple #5
0
 public StarSystem(Hashtable hash) : base(hash)
 {
     _id                  = (StarSystemId)GetValueFromHash(hash, "_id", _id);
     _x                   = (int)GetValueFromHash(hash, "_x", _x);
     _y                   = (int)GetValueFromHash(hash, "_y", _y);
     _size                = (Size)GetValueFromHash(hash, "_size", _size);
     _techLevel           = (TechLevel)GetValueFromHash(hash, "_techLevel", _techLevel);
     _politicalSystemType = (PoliticalSystemType)GetValueFromHash(hash, "_politicalSystemType", _politicalSystemType);
     _systemPressure      = (SystemPressure)GetValueFromHash(hash, "_systemPressure", _systemPressure);
     _specialResource     = (SpecialResource)GetValueFromHash(hash, "_specialResource", _specialResource);
     _specialEventType    = (SpecialEventType)GetValueFromHash(hash, "_specialEventType", _specialEventType);
     _tradeItems          = (int[])GetValueFromHash(hash, "_tradeItems", _tradeItems);
     _countDown           = (int)GetValueFromHash(hash, "_countDown", _countDown);
     _visited             = (bool)GetValueFromHash(hash, "_visited", _visited);
     _shipyardId          = (ShipyardId)GetValueFromHash(hash, "_shipyardId", _shipyardId);
 }
Exemple #6
0
 public CrewMember(Hashtable hash) : base(hash)
 {
     _id          = (CrewMemberId)GetValueFromHash(hash, "_id");
     _skills      = (int[])GetValueFromHash(hash, "_skills", _skills);
     _curSystemId = (StarSystemId)GetValueFromHash(hash, "_curSystemId", _curSystemId);
 }
Exemple #7
0
		public void WarpDirect()
		{
			_warpSystemId = SelectedSystemId;

			Commander.CurrentSystem.CountDown = CountDownStart;
			NewsResetEvents();
			CalculatePrices(WarpSystem);
			Arrival();
		}
Exemple #8
0
		private bool FindDistantSystem(StarSystemId baseSystem, SpecialEventType specEvent)
		{
			int bestDistance = 999;
			int system = -1;
			for (int i = 0; i < Universe.Length; i++)
			{
				int distance = Functions.Distance(Universe[(int)baseSystem], Universe[i]);
				if (distance >= 70 && distance < bestDistance && Universe[i].SpecialEventType == SpecialEventType.Na)
				{
					system = i;
					bestDistance = distance;
				}
			}
			if (system >= 0)
				Universe[system].SpecialEventType = specEvent;

			return (system >= 0);
		}
Exemple #9
0
		public Game(Hashtable hash, SpaceTrader parentWin) : base(hash)
		{
			_game = this;
			ParentWindow = parentWin;

			string version = (string)GetValueFromHash(hash, "_version");
			if (version.CompareTo(Consts.CurrentVersion) > 0)
				throw new FutureVersionException();

			_universe = (StarSystem[])ArrayListToArray((ArrayList)GetValueFromHash(hash, "_universe"), "StarSystem");
			_wormholes = (int[])GetValueFromHash(hash, "_wormholes", _wormholes);
			_mercenaries = (CrewMember[])ArrayListToArray((ArrayList)GetValueFromHash(hash, "_mercenaries"), "CrewMember");
			_commander = new Commander((Hashtable)GetValueFromHash(hash, "_commander"));
			_dragonfly = new Ship((Hashtable)GetValueFromHash(hash, "_dragonfly", _dragonfly.Serialize()));
			_scarab = new Ship((Hashtable)GetValueFromHash(hash, "_scarab", _scarab.Serialize()));
			_scorpion = new Ship((Hashtable)GetValueFromHash(hash, "_scorpion", _scorpion.Serialize()));
			_spaceMonster = new Ship((Hashtable)GetValueFromHash(hash, "_spaceMonster", _spaceMonster.Serialize()));
			_opponent = new Ship((Hashtable)GetValueFromHash(hash, "_opponent", _opponent.Serialize()));
			_chanceOfTradeInOrbit = (int)GetValueFromHash(hash, "_chanceOfTradeInOrbit", _chanceOfTradeInOrbit);
			_clicks = (int)GetValueFromHash(hash, "_clicks", _clicks);
			_raided = (bool)GetValueFromHash(hash, "_raided", _raided);
			_inspected = (bool)GetValueFromHash(hash, "_inspected", _inspected);
			_tribbleMessage = (bool)GetValueFromHash(hash, "_tribbleMessage", _tribbleMessage);
			_arrivedViaWormhole = (bool)GetValueFromHash(hash, "_arrivedViaWormhole", _arrivedViaWormhole);
			_paidForNewspaper = (bool)GetValueFromHash(hash, "_paidForNewspaper", _paidForNewspaper);
			_litterWarning = (bool)GetValueFromHash(hash, "_litterWarning", _litterWarning);
			_newsEvents = new ArrayList((int[])GetValueFromHash(hash, "_newsEvents", _newsEvents.ToArray(System.Type.GetType("System.Int32"))));
			_difficulty = (Difficulty)GetValueFromHash(hash, "_difficulty", _difficulty);
			_cheatEnabled = (bool)GetValueFromHash(hash, "_cheatEnabled", _cheatEnabled);
			_autoSave = (bool)GetValueFromHash(hash, "_autoSave", _autoSave);
			_easyEncounters = (bool)GetValueFromHash(hash, "_easyEncounters", _easyEncounters);
			_endStatus = (GameEndType)GetValueFromHash(hash, "_endStatus", _endStatus);
			_encounterType = (EncounterType)GetValueFromHash(hash, "_encounterType", _encounterType);
			_selectedSystemId = (StarSystemId)GetValueFromHash(hash, "_selectedSystemId", _selectedSystemId);
			_warpSystemId = (StarSystemId)GetValueFromHash(hash, "_warpSystemId", _warpSystemId);
			_trackedSystemId = (StarSystemId)GetValueFromHash(hash, "_trackedSystemId", _trackedSystemId);
			_targetWormhole = (bool)GetValueFromHash(hash, "_targetWormhole", _targetWormhole);
			_priceCargoBuy = (int[])GetValueFromHash(hash, "_priceCargoBuy", _priceCargoBuy);
			_priceCargoSell = (int[])GetValueFromHash(hash, "_priceCargoSell", _priceCargoSell);
			_questStatusArtifact = (int)GetValueFromHash(hash, "_questStatusArtifact", _questStatusArtifact);
			_questStatusDragonfly = (int)GetValueFromHash(hash, "_questStatusDragonfly", _questStatusDragonfly);
			_questStatusExperiment = (int)GetValueFromHash(hash, "_questStatusExperiment", _questStatusExperiment);
			_questStatusGemulon = (int)GetValueFromHash(hash, "_questStatusGemulon", _questStatusGemulon);
			_questStatusJapori = (int)GetValueFromHash(hash, "_questStatusJapori", _questStatusJapori);
			_questStatusJarek = (int)GetValueFromHash(hash, "_questStatusJarek", _questStatusJarek);
			_questStatusMoon = (int)GetValueFromHash(hash, "_questStatusMoon", _questStatusMoon);
			_questStatusPrincess = (int)GetValueFromHash(hash, "_questStatusPrincess", _questStatusPrincess);
			_questStatusReactor = (int)GetValueFromHash(hash, "_questStatusReactor", _questStatusReactor);
			_questStatusScarab = (int)GetValueFromHash(hash, "_questStatusScarab", _questStatusScarab);
			_questStatusSculpture = (int)GetValueFromHash(hash, "_questStatusSculpture", _questStatusSculpture);
			_questStatusSpaceMonster = (int)GetValueFromHash(hash, "_questStatusSpaceMonster", _questStatusSpaceMonster);
			_questStatusWild = (int)GetValueFromHash(hash, "_questStatusWild", _questStatusWild);
			_fabricRipProbability = (int)GetValueFromHash(hash, "_fabricRipProbability", _fabricRipProbability);
			_justLootedMarie = (bool)GetValueFromHash(hash, "_justLootedMarie", _justLootedMarie);
			_canSuperWarp = (bool)GetValueFromHash(hash, "_canSuperWarp", _canSuperWarp);
			_chanceOfVeryRareEncounter = (int)GetValueFromHash(hash, "_chanceOfVeryRareEncounter", _chanceOfVeryRareEncounter);
			_veryRareEncounters = new ArrayList((int[])GetValueFromHash(hash, "_veryRareEncounters", _veryRareEncounters.ToArray(System.Type.GetType("System.Int32"))));
			_options = new GameOptions((Hashtable)GetValueFromHash(hash, "_options", _options.Serialize()));
		}