/// <summary> /// Initializes a new instance of the <see cref="ShipNavigator"/> class. /// </summary> /// <param name="t">Ship Transform</param> /// <param name="data">Ship data.</param> public ShipNavigator(Transform t, ShipData data) { _transform = t; _data = data; _rigidbody = t.rigidbody; _rigidbody.useGravity = false; _eventMgr = GameEventManager.Instance; _gameTime = GameTime.Instance; _gameStatus = GameStatus.Instance; _generalSettings = GeneralSettings.Instance; Subscribe(); _gameSpeedMultiplier = _gameTime.GameSpeed.SpeedMultiplier(); // FIXME where/when to get initial GameSpeed before first GameSpeed change? _thrustHelper = new ThrustHelper(0F, 0F, _data.FullStlEnginePower); }
public void CompleteInitialization() { Subscribe(); // delay until Instance is initialized _gameTime = GameTime.Instance; // delay until Instance is initialized // initialize values without initiating change events _pauseState = PauseState.NotPaused; _isPaused = false; }
/// <summary> /// Initializes a new instance of the <see cref="ANavigator2" /> class. /// </summary> /// <param name="data">Item data.</param> public ANavigator2(AMortalItemData data) { Data = data; _gameTime = GameTime.Instance; _gameSpeedMultiplier = _gameTime.GameSpeed.SpeedMultiplier(); // FIXME where/when to get initial GameSpeed before first GameSpeed change? AssessFrequencyOfCourseProgressChecks(); // Subscribe called by derived classes so all constructor references can be initialized before they are used by Subscribe }
/// <summary> /// Initializes a new instance of the <see cref="ShieldGenerator"/> class. /// </summary> /// <param name="stat">The stat.</param> /// <param name="name">The optional unique name for this equipment. If not provided, the name embedded in the stat will be used.</param> public ShieldGenerator(ShieldGeneratorStat stat, string name = null) : base(stat, name) { _gameTime = GameTime.Instance; CurrentCharge = Constants.ZeroF; }
/// <summary> /// Initializes a new instance of the <see cref="AWeapon" /> class. /// </summary> /// <param name="stat">The stat.</param> /// <param name="name">The optional unique name for this equipment. If not provided, the name embedded in the stat will be used.</param> public AWeapon(AWeaponStat stat, string name = null) : base(stat, name) { _gameTime = GameTime.Instance; _qualifiedEnemyTargets = new HashSet<IElementAttackable>(); _combatResults = new Dictionary<IElementAttackable, CombatResult>(); }
/// <summary> /// Explicit static constructor that enables lazy instantiation by telling C# compiler /// not to mark type as beforefieldinit. /// </summary> static GameTime() { // try, catch and resolve any possible exceptions here instance = new GameTime(); }
public WaitForDate(GameDate date) { _gameTime = GameTime.Instance; _targetDate = date; }
/// <summary> /// Initializes a new instance of the <see cref="ActiveCountermeasure"/> class. /// </summary> /// <param name="stat">The stat.</param> /// <param name="name">The optional unique name for this equipment. If not provided, the name embedded in the stat will be used.</param> public ActiveCountermeasure(ActiveCountermeasureStat stat, string name = null) : base(stat, name) { _gameTime = GameTime.Instance; _qualifiedThreats = new List<IInterceptableOrdnance>(); }
/// <summary> /// Initializes a new instance of the <see cref="ShipNavigator" /> class. /// </summary> /// <param name="ship">The ship.</param> public ShipNavigator(IShipModel ship) { _ship = ship; _data = ship.Data; _gameTime = GameTime.Instance; _gameSpeedMultiplier = _gameTime.GameSpeed.SpeedMultiplier(); // FIXME where/when to get initial GameSpeed before first GameSpeed change? _gameStatus = GameStatus.Instance; AssessFrequencyOfCourseProgressChecks(); Subscribe(); }
private void InitializeLocalValuesAndReferences() { _gameTime = GameTime.Instance; _intendedHeading = CurrentHeading; // initialize to something other than Vector3.zero which causes problems with LookRotation }
private void Initialize() { _gameTime = GameTime.Instance; _gameMgr = References.GameManager; _gameSpeedMultiplier = _gameTime.GameSpeed.SpeedMultiplier(); Subscribe(); }
/// <summary> /// Initializes a new instance of the <see cref="WaitForHours"/> class. /// </summary> /// <param name="duration">The duration.</param> public WaitForHours(GameTimeDuration duration) { _gameTime = GameTime.Instance; _targetDate = new GameDate(duration); _duration = duration; }
/// <summary> /// Initializes a new instance of the <see cref="ANavigator" /> class. /// </summary> /// <param name="data">Item data.</param> public ANavigator(AMortalData data) { Data = data; _gameTime = GameTime.Instance; _gameSpeedMultiplier = _gameTime.GameSpeed.SpeedMultiplier(); // FIXME where/when to get initial GameSpeed before first GameSpeed change? _courseUpdatePeriod /= _gameSpeedMultiplier; // Subscribe called by derived classes so all constructor references can be initialized before they are used by Subscribe }