Skip to content

Instantly share code, notes, and snippets.

@multilococ
multilococ / gist:3ff4f1fb4db5bc9c80dfa69e3422fb43
Last active May 3, 2025 13:02
27. В функции можно использовать функции её уровня и на один ниже MVP
using System.Data;
using System.Reflection;
using System.Security.Cryptography;
using System.Text;
public class Programm
{
public static void Main()
{
BallotView ballotView = new BallotView(new PresenterFactory());
namespace IMJunior
{
public class Program
{
public static void Main(string[] args)
{
Dictionary<string, IPaymentSystemFactory>paymentFactories = new Dictionary<string, IPaymentSystemFactory>()
{
{"1", new QiwiFactory()},
{"2", new WebMoneyFactory()},
public void Shoot(Player player) { }
public string FindBy(int index) { }
public void Enable()
{
_effects.StartEnableAnimation();
}
public void Disable()
{
_pool.Free(this);
}
public class Player
{
private readonly Mover _mover;
private readonly Weapon _weapon;
public Player(Mover mover, Weapon weapon)
{
if (mover == null || weapon == null)
throw new ArgumentNullException();
}
@multilococ
multilococ / gist:18e29fc76dbd364bbf40328eb0d5e1dd
Last active May 1, 2025 15:33
CleanCode_ExampleTask17.cs
public static void SpawnObject()
{
//spawn logic
}
public static void RandomizeChance()
{
_chance = Random.Range(0, 100);
}
class Player { }
class Weapon { }
class Follower { }
class UnitReceiver
{
public IReadOnlyCollection<Unit> Units { get; private set; }
}
public class Weapon
{
public void Shoot() { }
}
private int _armySize = 10;
private int _coinsAmount = 10;
private string _firstName = "Vladislav";
@multilococ
multilococ / gist:8b1b8ce502e78e179cd52cb5d42d3984
Last active May 1, 2025 15:31
CleanCode_ExampleTask10.cs
public class Weapon
{
private int _bullets;
public bool CanShoot => _bullets > 0;
public void Shoot()
{
if (CanShoot == false)
throw new InvalidOperationException(nameof(CanShoot));