Example #1
0
 private void Awake()
 {
     fuelManager       = GetComponent <FuelManager>();
     this.normalcolorL = this.leftImage.color;
     this.normalcolorR = this.rightImage.color;
     shipExplote       = GetComponent <ShipExplote>();
 }
Example #2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            this._appSettings = new AppSettings();

            this._debugLogger = new DebugManager();
            this._debugLogger.Enable();

            this._simLogger = new iRacingLogger(4);
            this._simLogger.DriverConnected    += this.OnRaceLoggerConnection;
            this._simLogger.DriverDisconnected += this.OnRaceLoggerDisconnection;

            this._fuelManager = new FuelManager(this._simLogger, this._debugLogger, 1);

            this._simLogger.StartListening();

            var vm = new ApplicationViewModel();
            var mw = new MainWindow
            {
                DataContext = vm
            };

            mw.Closing += this.WindowClosing;
            mw.Show();

            this._programConfigurator = new ProgramLoader(this.DebugLogger);

            var pm = new ProgramManager(this._simLogger, this._programConfigurator);

            //pm.Load("default");
            //pm.StartProgram();

            this.MainWindow.Title = "Disconnected - Driver ID: ?";
        }
Example #3
0
 private void Start()
 {
     resourceManager      = GetComponent <ResourceManager>();
     shipManager          = GetComponent <ShipManager>();
     fuelManager          = GetComponent <FuelManager>();
     upgradeManager       = GetComponent <UpgradeManager>();
     createUpgradeButtons = FindObjectOfType <CreateUpgradeButtons>();
 }
Example #4
0
 void OnCollisionEnter2D(Collision2D other)
 {
     if (other.gameObject.tag == "Player")
     {
         Destroy(this.gameObject);
         FuelManager.FuelUp();
     }
 }
Example #5
0
 void OnCollisionEnter2D(Collision2D other)
 {
     if (other.gameObject.tag == "Player")
     {
         FuelManager.AddFuelToWorldFuel();
         LevelManager.LevelRenderNext();
     }
 }
 private void Start()
 {
     theScoreManager        = FindObjectOfType <ScoreManager>();
     theLifesManager        = FindObjectOfType <LifesManager>();
     theBridgeNumberManager = FindObjectOfType <BridgeNumberManager>();
     respawnPoint           = GameObject.Find("RespawnPoint");
     player         = GameObject.Find("Player");
     map_length     = 50.19;
     theFuelManager = FindObjectOfType <FuelManager>();
 }
Example #7
0
 private void FindObjects()
 {
     endHole          = FindObjectOfType <EndHole>();
     sceneLoader      = FindObjectOfType <SceneLoader>();
     fuelManager      = FindObjectOfType <FuelManager>();
     pauseManager     = FindObjectOfType <PauseManager>();
     scoreManager     = ScoreManager.Instance;
     inputManager     = InputManager.Instance;
     cheatCodeManager = CheatCodeManager.Instance;
 }
 void Start()
 {
     rb2d = GetComponent <Rigidbody2D>();
     mapStartingPosition = new Vector3(0, 0, 0);
     theLifesManager     = FindObjectOfType <LifesManager>();
     theFuelManager      = FindObjectOfType <FuelManager>();
     respawnPoint        = GameObject.Find("RespawnPoint");
     mapDestructionPoint = GameObject.Find("MapDestructionPoint");
     startingPosition    = -24.5;
     destructionPointStartingPosition = 26.98;
 }
Example #9
0
 protected override void Init()
 {
     base.Init ();
     startPosition = transform.position;
     fuelManager = GetComponent<FuelManager> ();
     healthManager.Damaged += (amount) =>
     {
         if (HealthChanged != null)
             HealthChanged (amount);
     };
 }
Example #10
0
 void OnTriggerEnter(Collider col)
 {
     if (col.GetComponent <PlayerController>())
     {
         soundsController.PlayFuelTankPick();
         ChangePosition();
         FuelManager.AddFuel(fuel);
     }
     else
     {
         ChangePosition();
     }
 }
Example #11
0
        public void ManagerHasNoPending()
        {
            //arrange
            FuelManager manager = new FuelManager();
            FuelTank    tank    = new FuelTank("Unl", 1000);
            FuelReceipt reciept = new FuelReceipt(tank, 100);

            manager.Commands.Add(reciept);
            //act
            manager.ExecuteCommands();
            //assert
            Assert.AreEqual(false, manager.HasPendingCommands());
        }
 private void Start()
 {
     rb                  = GetComponent <Rigidbody2D>();
     fuelManager         = GetComponent <FuelManager>();
     inventory           = GetComponent <Inventory>();
     spriteTR            = transform.GetChild(0);
     movingAnim          = spriteTR.GetComponent <Animator>();
     horizontalDrillAnim = spriteTR.GetChild(0).GetComponent <Animator>();
     downDrillAnim       = spriteTR.GetChild(1).GetComponent <Animator>();
     horizontalDrillGO   = spriteTR.GetChild(0).gameObject;
     downDrillGO         = spriteTR.GetChild(1).gameObject;
     thrusterGO          = spriteTR.GetChild(2).gameObject;
     thrusterAnim        = thrusterGO.GetComponent <Animator>();
     digSource           = GetComponent <AudioSource>();
     thrusterSource      = thrusterGO.GetComponent <AudioSource>();
 }
Example #13
0
        public FuelCard(Entity.Fuel fuel)
        {
            FuelGuid  = fuel.FuelGuid;
            Libel     = fuel.Libel;
            Threshold = fuel.Threshold.ToString("0.##");
            var lastPrice = FuelManager.GetFuelLastPrice(fuel.FuelGuid).Result;

            CurrentDoublePrice = lastPrice.ActualPrice;
            CurrentPrice       = lastPrice.ActualPrice.ToString("0.##\\ dhs/L");
            LastPriceUpdate    = "Derniere modification du prix " + lastPrice.FromDate.GetValueOrDefault().ToLongDateString();
            CiternesNumber     = " Citerne".ToQuantity(fuel.Citernes.Count);

            var curBalance = FuelManager.StaticGetFuelBalance(fuel.FuelGuid).Result;

            CurrentStock = curBalance.ToString("0.##\\L") + " en stock /" + fuel.Citernes.Sum(c => c.MaxCapacity).ToString("0.##\\L");
            Pourcentage  = ((curBalance * 100) / fuel.Citernes.Sum(c => c.MaxCapacity)).ToString("0.##\\%");
        }
Example #14
0
        // GET: AirFilter
        public async Task <ActionResult> Index(int?carID, string sortOrder)
        {
            var fuelQueryable = from s in db.Fuel.Include(a => a.Car)
                                select s;

            if (carID != null && carID > 0)
            {
                fuelQueryable = fuelQueryable.Where(d => d.CarID == carID);
                ViewBag.CarID = carID;
                UpdateCarDescription(carID);
            }

            var sortDirection = ControllerHelper.GetSortOrder(sortOrder);

            UpdateSortDirection(sortDirection);
            fuelQueryable = FuelManager.AddSortToQuery(fuelQueryable, sortOrder);

            return(View(await fuelQueryable.ToListAsync()));
        }
Example #15
0
        static void Main(string[] args)
        {
            IOutputWriter outputWriter = new ConsoleWriter();
            IInputReader  inputReader  = new ConsoleReader();


            StoryWriter     storyWriter     = new StoryWriter(outputWriter);
            UserInputReader userInputReader = new UserInputReader(inputReader, outputWriter);

            storyWriter.Title();
            storyWriter.AllDays();

            for (int input = userInputReader.GetNumericInputInclusive(MaxMenuOptions); input != MaxMenuOptions; input = userInputReader.GetNumericInputInclusive(MaxMenuOptions))
            {
                switch (input)
                {
                case 1:
                    FuelCounterUpper fuelCounterUpper = new FuelCounterUpper(outputWriter);
                    fuelCounterUpper.Initialize();
                    break;

                case 2:
                    IntcodeComputer intcodeComputer = new IntcodeComputer(outputWriter);
                    intcodeComputer.Initialize();
                    break;

                case 3:
                    FuelManager fuelManager = new FuelManager(outputWriter);
                    fuelManager.Initialize();
                    break;

                case 4:
                    VenusFuelDepot fuelDepot = new VenusFuelDepot(outputWriter);
                    fuelDepot.Initialize();
                    break;
                }

                inputReader.ReadLine();
                storyWriter.AllDays();
            }
        }
    public void UpdateValue()
    {
        float angle = Mathf.Clamp(90f - (0.9f * FuelManager.GetFuel()), 0f, 90f);

        arrow.rotation = Quaternion.Euler(0f, 0f, angle);
        if (FuelManager.GetFuel() < FuelManager.GetMaxFuel() / 5)
        {
            icon.color = Color.yellow;

            if (!beeped)
            {
                soundsController.PlayLowFuel();
                beeped = true;
            }
        }
        else
        {
            icon.color = Color.black;
            beeped     = false;
        }
    }
Example #17
0
    private void Update()
    {
        if (isInside)
        {
            float fuelToBuy = playerFuel.GetMissingFuel();
            int   cost      = Mathf.CeilToInt(fuelToBuy);
            StationsText.SetText("PRESS F TO REFUEL\nCOST: $" + cost);
        }

        if (PlayerGO == null)
        {
            PlayerGO = GameManager.GetCurrentPlayer();
            if (PlayerGO == null)
            {
                return;
            }
            playerFuel = PlayerGO.GetComponent <FuelManager>();
        }

        if (isInside && Input.GetKeyDown(KeyCode.F))
        {
            float fuelToBuy = playerFuel.GetMissingFuel();
            int   cost      = Mathf.CeilToInt(fuelToBuy);
            if (cost > 0 && playerMoney.GetMoney() > 0)
            {
                float perc = (float)playerMoney.GetMoney() / cost;
                AudioSource.PlayClipAtPoint(GameManager.Instance.CoinPickupSound, PlayerGO.transform.position);
                if (playerMoney.GetMoney() >= cost)
                {
                    playerFuel.FillFuel();
                    playerMoney.DecreaseMoney(cost);
                }
                else if (playerMoney.GetMoney() > 0)
                {
                    playerFuel.AddFuel(fuelToBuy * perc);
                    playerMoney.DecreaseMoney(playerMoney.GetMoney());
                }
            }
        }
    }
Example #18
0
 void Awake()
 {
     armourManager = GetComponent <ArmourManager>();
     fuelManager   = GetComponent <FuelManager>();
 }
Example #19
0
 void Awake()
 {
     Instance = this;
 }
 private void Start()
 {
     fuelManager = FindObjectOfType <FuelManager>();
     fuelManager.ModifyCapacity(capacity);
 }
 void Awake()
 {
     fuelManager = FindObjectOfType <FuelManager>();
     gameManager = FindObjectOfType <GameManager>();
 }
 void ResetStates()
 {
     ScoreManager.Reset();
     FuelManager.Reset();
 }
 private void Start()
 {
     fuelManager = GetComponent <FuelManager>();
     GameManager.Instance.PP.profile.TryGetSettings(out vignette);
 }
Example #24
0
 public static void LevelRender(int lvl)
 {
     sCurrentLevel = lvl;
     FuelManager.FuelReset();
     SceneManager.LoadScene(sPathStandart + lvl);
 }
Example #25
0
 public static void LevelRenderPrevious()
 {
     LevelDown();
     FuelManager.FuelReset();
     SceneManager.LoadScene(sPathStandart + sCurrentLevel);
 }
Example #26
0
 public static void LevelRenderNext()
 {
     LevelUp();
     FuelManager.FuelReset();
     SceneManager.LoadScene(sPathStandart + sCurrentLevel);
 }
Example #27
0
 // Update is called once per frame
 void Update()
 {
     fuelText.text = "Fuel: " + FuelManager.FuelGet() + "/10";
 }
 void Start()
 {
     fuelSystem = GetComponent <FuelManager>();
 }
Example #29
0
 void OnDestroy()
 {
     Instance = null;
 }
Example #30
0
 // Use this for initialization
 void Start()
 {
     this.GetComponent <Text>().text = "" + FuelManager.WorldFuelGet();
 }
Example #31
0
 private void Start()
 {
     theFuelManager      = FindObjectOfType <FuelManager>();
     thePlayerController = FindObjectOfType <PlayerController>();
 }