コード例 #1
0
        public void Consume(EntityState state)
        {
            Record rec = null;

            if (Records.TryGetValue(state, out rec))
            {
                rec.Heap = MathLambda.SubtractTillZero(rec.Heap, Heap_Loss);
                if (rec.Heap <= 0)
                {
                    Records.Remove(state);
                }
            }
        }
コード例 #2
0
    //	public void Sweep

    public void Update()
    {
        if (HitRefreshProgress >= HitRefreshTime)
        {
            HitRefreshProgress = 0;
//			AlliesHit.Clear ();
            EnemiesHit.Clear();
        }
        else
        {
            HitRefreshProgress = MathLambda.AddTillEqualTo(HitRefreshProgress, Time.deltaTime, HitRefreshTime);
        }
    }
コード例 #3
0
    //public Shape shape;
    //public float height;
    //public 2Dimensions StartDimensions;
    //public 2Dimensions EndDimensions;

    public new void Update()
    {
        if (Persistance > 0)
        {
            Destroy(gameObject);
        }
        else
        {
            if (PersistanceProgress >= Persistance)
            {
                PersistanceProgress = MathLambda.AddTillEqualTo(PersistanceProgress, Time.deltaTime, Persistance);
            }
        }


        base.Update();
    }
コード例 #4
0
        //
        public void Collect(EntityState state)
        {
            Record rec = null;

            if (Records.TryGetValue(state, out rec))
            {
                rec.Heap = MathLambda.AddTillEqualTo(rec.Heap, Heap_Gain, Maximum_Heap);
                if (Refreshable)
                {
                    rec.Progress = 0;
                }
            }
            else
            {
                rec = CreateInstance();
//				state.Death_Handler += rec.DeathLoss;
                Records.Add(state, rec);
            }
        }
コード例 #5
0
        //	//
        //	public void Attach (IState state)
        //	{
        //		state.Update_Handler += Refresh;
        //		state.Death_Handler += DeathLoss;
        //
        //	}
        //
        //	public void Detach (IState state)
        //	{
        //		state.Update_Handler -= Refresh;
        //		state.Death_Handler -= DeathLoss;
        //	}

        //
        public void Update()
        {
            foreach (KeyValuePair <EntityState, Record> entry in Records)
            {
                if (entry.Value.Heap > 0)
                {
                    if (Maximum_Progress != 0)
                    {
                        entry.Value.Progress = MathLambda.AddTillEqualTo(entry.Value.Progress, Time.deltaTime, (float)Maximum_Progress);
                        if (entry.Value.Progress >= Maximum_Progress)
                        {
                            entry.Value.Heap = MathLambda.SubtractTillZero(entry.Value.Heap, Heap_Loss);
                        }
                    }
                }
                else
                {
                    Records.Remove(entry.Key);
                }
            }
        }
コード例 #6
0
 public void DeathLoss()
 {
     Heap = MathLambda.SubtractTillZero(Heap, Heap_Lost_On_Death);
 }