private void Initialization() { damageType = new BleedingDamage(); unitPresenter = gameObject.GetComponent <UnitPresenter>(); Debug.Log(gameObject.name + @": ""I am bleeding!"""); }
//************************************************** //* FILL DATA ON START //************************************************** private void InitializeFormWithData() { _unitPresenter = new UnitPresenter(new UnitsServices()); unitsGrid.ItemsSource = unitsList; unitsList.AddRange(_unitPresenter.GetAllUnits()); cleanView(); }
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(); } }
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!"""); }
internal override async Task AddRecord() { try { _unit = new EditingUnitForm(); _presenter = new UnitPresenter(_unit); _unit.ShowDialog(); await Update(); } catch (Exception ex) { ShowError(ex.Message); } }
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); } }
/// <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; } } }
private void initUnitLists() { unitsRepository = GameObject.Find("Units").GetComponent <UnitsRepository>(); unitsRepository.initialize(); unitPresenter = GameObject.Find("Units").GetComponent <UnitPresenter>(); }
private void Initialization() { damageType = new PoisonDamage(); unitPresenter = gameObject.GetComponent <UnitPresenter>(); Debug.Log(gameObject.name + @": ""I was poisoned!"""); }