Skip to content

Instantly share code, notes, and snippets.

View profftols's full-sized avatar
🎯
Focusing

Ivan Korikov profftols

🎯
Focusing
View GitHub Profile
@profftols
profftols / CleanCode_ExampleTask30.cs
Last active March 26, 2024 11:29
30. Аргументы-флаги - это плохо
public void ActivateAnimation(bool isActive)
{
isActive ? _effects.StartEnableAnimation() : _pool.Free(this);
}
using System;
namespace ConsoleApplication1
{
public static class Program
{
public static void Main(string[] args)
{
var orderForm = new OrderForm();
@profftols
profftols / public class Timer
Last active March 22, 2024 07:51
Счетчик
using System.Collections;
using TMPro;
using UnityEngine;
[RequireComponent(typeof(TextMeshProUGUI))]
public class Timer : MonoBehaviour
{
private Coroutine _counter;
private TextMeshProUGUI _textDisplay;
public class RegistrationPerson
{
private string _personPassport { get; set; }
private PollingStation _station;
private int _maxLength = 10;
public RegistrationPerson(string personPassport, PollingStation station)
{
_personPassport = personPassport.Trim();
_station = station;
@profftols
profftols / Mover
Last active March 25, 2024 08:08
20.
public class Mover
{
public float DirectionX { get; private set; }
public float DirectionY { get; private set; }
public float Speed { get; private set; }
public Mover(float directionX, float directionY, float speed)
{
DirectionX = directionX;
DirectionY = directionY;
public static void Spawn()
{
//Создание объекта на карте
}
public static void RollChance()
{
_chance = Random.Range(0, 100);
}
public class PlayerInfo { }
public class Gun { }
public class TargetFollower { }
public class UnitStorage
{
public IReadOnlyCollection<Unit> Units {get; private set;}
}
private int _armySize = 10;
private int _coins = 10;
private string _name = "Vladislav";
public class Weapon
{
private int _numberShotsFired = 1;
private int _bullets;
private bool CanShoot => _bullets >= _numberShotsFired;
public void Shoot()
{
if(CanShoot)