@EmpeRoarx/FuncPipe
C#

No description

Files
  • main.cs
main.cs
using System;

class MainClass {
  public static void Main (string[] args) {
    
    var Gouko = new Hero();
    Gouko.Name = "Gouko";
    Gouko.Energy = 100;
    Gouko.LevelUp = x => x.RashingGun().RayGun().KamihamiWave();
    var powerLevel = Gouko.LevelUp(10);
    Console.WriteLine(powerLevel);
    
    var Naruto = new Hero();
    Naruto.Name = "Naruto";
    Naruto.Energy = 50;
    Naruto.LevelUp = x => {
      var z = 5;
      return z * x;
    };
    var naruloLevel = Naruto.LevelUp(5);
    Console.WriteLine(naruloLevel);
  }
  
}

public interface IHero{
}

public class Hero : IHero
{
  public string Name { get; set; }
  public int Energy{ get; set; }
  public Func<int,int> LevelUp { get; set; }
  
}
  
public static class HeroPipe{
  public static int RashingGun(this int power){
    return power * 2;
  }
  public static int RayGun(this int power){
    return power * 10;
  }
  public static int KamihamiWave(this int power){
    return power * 100;
  }
}
Mono C# compiler version 4.0.4.0