Skip to content

Instantly share code, notes, and snippets.

@Venarry
Venarry / CleanCode_ExampleTask14.cs
Created January 25, 2024 00:02
Берите имена из предметной области. Не мяукало, а кошка.
public class Gun
{
public void Shoot() { }
}
@Venarry
Venarry / PaymentSystems.cs
Last active January 23, 2024 23:47
Платёжные системы
using System.Runtime.Intrinsics.Arm;
using System.Security.Cryptography;
public class Program
{
static void Main(string[] args)
{
//Выведите платёжные ссылки для трёх разных систем платежа:
//pay.system1.ru/order?amount=12000RUB&hash={MD5 хеш ID заказа}
//order.system2.ru/pay?hash={MD5 хеш ID заказа + сумма заказа}
@Venarry
Venarry / Интернет магазин.cs
Created January 22, 2024 22:45
Интернет магазин
public class Program
{
private static void Main()
{
Good iPhone12 = new Good("IPhone 12");
Good iPhone11 = new Good("IPhone 11");
Warehouse warehouse = new Warehouse();
Shop shop = new Shop(warehouse);
@Venarry
Venarry / BulletSpawner.cs
Created January 16, 2024 05:03
Homework Гений Code Style
using System.Collections;
using UnityEngine;
[RequireComponent(typeof(Rigidbody))]
public class BulletSpawner : MonoBehaviour
{
[SerializeField] private Transform _target;
[SerializeField] private Bullet _prefab;
[SerializeField] private float _speed;
[SerializeField] private float _shootCooldown;
public void Shoot(Player player) { }
public string FindByIndex(int index) { }
public void Enable()
{
_enable = true; // оставил поле исходя из контекста
_effects.StartEnableAnimation();
}
public void Disable()
{
_enable = false;
_pool.Free(this);
namespace IMJunior
{
class Program
{
static void Main()
{
PaymentDataSource paymentDataSource = new();
var factories = paymentDataSource.Factories;
OrderForm orderForm = new OrderForm(factories.Keys);
public class Player
{
private readonly PlayerMovement _movement;
private readonly PlayerWeapon _weapon;
public Player(
PlayerMovement movement,
PlayerWeapon weapon,
string name,
int age)
public static void CreateObject()
{
//Создание объекта на карте
}
public static void DetermineRandomChance()
{
_chance = Random.Range(0, 100);
}
class PlayerProgress { }
// вообще в MVC можно было бы использовать GunController, но если исключить такую возможность, то я бы написал так
class Gun { }
class Follower { }
class UnitsProvider
{
public IReadOnlyCollection<Unit> Units { get; private set; }
}