@EmpeRoarx/FuncPipe
C#

No description

fork
loading
repl talk
(games)
Files
  • main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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