This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IPlayerResources | |
{ | |
void SetResource(string type, int amount); | |
int GetResource(string type); | |
(string, int)[] GetAllResources(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Необходимо реализовать интерфейс для инвентаря с | |
//оружиями с помощью паттерна Presentation Model | |
//То есть интерфефс должен поддерживать возможность: | |
//1. Добавлять и удалять N оружий | |
//2. Хранить актуальное кол-во патронов для каждого оружия | |
//3. При нажатии на оружие, будет выбираться текущее оружиеё | |
public interface IWeapon | |
{ | |
event Action<string> OnAmmoChanged; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: доработать | |
public sealed class Effect | |
{ | |
public event Action<float> OnValueChanged; | |
public float Value { get; private set; } | |
public Sprite Icon { get; } | |
public Color Color { get; } | |
public void SetValue(float value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IGameListener | |
{ | |
} | |
public interface IGameStartListener : IGameListener | |
{ | |
void OnStartGame(); | |
} | |
public interface IGameFinishListener : IGameListener |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Упражнение №1 | |
public class ClickAndSpawnEnemy : MonoBehaviour | |
{ | |
[SerializeField] private GameObject _enemyPrefab; | |
[SerializeField] private EnemyManager _enemyManager; | |
private void Update() { | |
if (!Input.GetMouseButtonDown(0)) { | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Analytics system: | |
public interface IAnalyicsManager | |
{ | |
void LogEvent(string key, params AnalyticsParam[] parameters); | |
} | |
public struct AnalyticsParam | |
{ | |
public string name; | |
public string value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IMoneyStorage | |
{ | |
event Action<int> OnMoneyChanged; | |
event Action<int> OnMoneyEarned; | |
event Action<int> OnMoneySpent; | |
int Money { get; } | |
void EarnMoney(int amount); | |
void SpendMoney(int amount); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Elementary; | |
using Entities; | |
using Game.GameEngine; | |
using Game.GameEngine.Animation; | |
using Game.GameEngine.Mechanics; | |
using JetBrains.Annotations; | |
using Declarative; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using Elementary; | |
using UnityEngine; | |
[Using] | |
public sealed class MyApplication : Element, IRootElement | |
{ | |
public IClient Client { get; private set; } | |
public RepositoryLayer RepositoryLayer { get; private set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Elementary; | |
using UnityEngine; | |
[Using] | |
public sealed class UserInteractor : Interactor | |
{ | |
protected override void OnPrepare(Element _) | |
{ | |
var userRepository = this.GetRepository<UserRepository>(); | |
Debug.Log($"User interactor -> {userRepository.GetType().Name}"); |
NewerOlder