예제 #1
0
 /// <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);
 }
예제 #2
0
        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;
        }
예제 #3
0
 /// <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
 }
예제 #4
0
 /// <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;
 }
예제 #5
0
 /// <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>();
 }
예제 #6
0
 /// <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();
 }
예제 #7
0
 public WaitForDate(GameDate date) {
     _gameTime = GameTime.Instance;
     _targetDate = date;
 }
예제 #8
0
 /// <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>();
 }
예제 #9
0
 /// <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();
 }
예제 #10
0
 private void InitializeLocalValuesAndReferences() {
     _gameTime = GameTime.Instance;
     _intendedHeading = CurrentHeading;  // initialize to something other than Vector3.zero which causes problems with LookRotation
 }
예제 #11
0
 private void Initialize() {
     _gameTime = GameTime.Instance;
     _gameMgr = References.GameManager;
     _gameSpeedMultiplier = _gameTime.GameSpeed.SpeedMultiplier();
     Subscribe();
 }
예제 #12
0
 /// <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;
 }
예제 #13
0
 /// <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
 }