MPlayer.MPlayer C# (CSharp) Method

MPlayer() public method

public MPlayer ( int index, bool isHuman, string name, MColor, color ) : System
index int
isHuman bool
name string
color MColor,
return System
    public MPlayer(int index, bool isHuman, string name, MColor color)
    {
        this.index = index;
        this.isHuman = isHuman;
        this.name = name;
        this.color = color;

        framesTillBeast = maxFramesTillBeast;

        stats = new MPlayerStat[4];

        stats[0] = statSpeed = new MPlayerStat(0,"speed",0,30);
        stats[1] = statAttack = new MPlayerStat(1,"attack",0,30);
        stats[2] = statDefence = new MPlayerStat(2,"defence",0,30);
        stats[3] = statHealth = new MPlayerStat(3,"health",0,30);

        currentStatTotal = 0;
        statTotal = 0;

        foreach(MPlayerStat stat in stats)
        {
            stat.player = this;
            statTotal += stat.max;
            stat.SignalChange += HandleStatChange;
        }

        isDirty = true;
    }