Example #1
0
    private void Initialization()
    {
        damageType = new BleedingDamage();

        unitPresenter = gameObject.GetComponent <UnitPresenter>();
        Debug.Log(gameObject.name + @": ""I am bleeding!""");
    }
Example #2
0
 //**************************************************
 //*             FILL DATA ON START
 //**************************************************
 private void InitializeFormWithData()
 {
     _unitPresenter        = new UnitPresenter(new UnitsServices());
     unitsGrid.ItemsSource = unitsList;
     unitsList.AddRange(_unitPresenter.GetAllUnits());
     cleanView();
 }
Example #3
0
    private void Initialization()
    {
        damageType = new FireDamage();
        Debug.Log(gameObject.name + ": \"I am burning!\"");
        unitPresenter = gameObject.GetComponent <UnitPresenter>();


        // Проверить, есть ли на цели лед. Если есть, то разморозить.
        if (unitPresenter.UnitStats.gameObject.TryGetComponent(out Freeze freeze))
        {
            freeze.SelfDestruction();
        }
    }
Example #4
0
    private void Initialization()
    {
        damageType    = new IceDamage();
        unitPresenter = gameObject.GetComponent <UnitPresenter>();

        // Сбрасываем огонь
        if (gameObject.TryGetComponent(out Burn burn))
        {
            burn.SelfDestruction();
        }

        Debug.Log(gameObject.name + @": ""I was frozen!""");
    }
Example #5
0
        internal override async Task AddRecord()
        {
            try
            {
                _unit      = new EditingUnitForm();
                _presenter = new UnitPresenter(_unit);
                _unit.ShowDialog();

                await Update();
            }
            catch (Exception ex)
            {
                ShowError(ex.Message);
            }
        }
Example #6
0
        internal override async Task EditRecord()
        {
            try
            {
                if (ExistsRecord)
                {
                    _unit      = new EditingUnitForm();
                    _presenter = new UnitPresenter(_unit, Item.Code);
                    _unit.ShowDialog();

                    await Update();
                }
            }
            catch (Exception ex)
            {
                ShowError(ex.Message);
            }
        }
Example #7
0
        /// <summary>
        /// Обработка нажатия кнопок в окне свойств юнита
        /// </summary>
        private void AGrid_Click(object sender, RoutedEventArgs e)
        {
            Button button = e.OriginalSource as Button;

            switch (button.Name)
            {
            case "ClosingButton":
            {
                this.Hide();
                break;
            }

            case "BuildButton":
            {
                ContentControl unitControl   = e.Source as ContentControl;
                UnitPresenter  unitPresenter = unitControl.Content as UnitPresenter;
                Unit           unit          = unitPresenter.Unit;
                UI.Build(unit);
                break;
            }
            }
        }
Example #8
0
 private void initUnitLists()
 {
     unitsRepository = GameObject.Find("Units").GetComponent <UnitsRepository>();
     unitsRepository.initialize();
     unitPresenter = GameObject.Find("Units").GetComponent <UnitPresenter>();
 }
Example #9
0
 private void Initialization()
 {
     damageType    = new PoisonDamage();
     unitPresenter = gameObject.GetComponent <UnitPresenter>();
     Debug.Log(gameObject.name + @": ""I was poisoned!""");
 }