示例#1
0
    public HistoryStep GetLastStep(HistoryStep.RecordType type)
    {
        HistoryStep lastHistory = null;

        int hi = parent.GetHeroInfo().history.Count - 1;

        while (hi >= 0)
        {
            lastHistory = parent.GetHeroInfo().history[hi];
            if (lastHistory.type == type)
            {
                break;
            }
            hi--;
        }

        return(lastHistory);
    }
示例#2
0
    public void Record(Damage[] dmgs, HistoryStep.RecordType type)
    {
        HistoryStep step = new HistoryStep();

        step.type   = type;
        step.block  = new SimBlock(parent.TemSimpleBlock);
        step.health = m_health;
        if (dmgs == null)
        {
            step.damages = new Damage[0];
        }
        else
        {
            step.damages = new Damage[dmgs.Length];
            for (int i = 0; i < dmgs.Length; ++i)
            {
                step.damages[i] = dmgs[i];
            }
        }
        history.Add(step);
    }