コード例 #1
0
 public Health(Life life, double value)
 {
     this.Name        = "Health";
     this.Description = "The health rate of the life, and it will die when the healty is empty.";
     this.Life        = life;
     this.value       = value;
     Empty            = new Stimulus(life, life.NoReactionStimulus);
     life.BuildReaction(Empty, life.Behaviours[Behaviours.Action.Die.TypeID]);
     Low = new Stimulus(life, life.NoReactionStimulus);
     life.StimulusList.Add(Low);
 }
コード例 #2
0
ファイル: Life.cs プロジェクト: SardineFish/LifeGameX
        private void cloneReaction(Stimulus stimulusFrom, Stimulus stimulusTo, Life life)
        {
            var behaviorList = new List <Behaviour>();

            foreach (var reaction in stimulusFrom.Reactions)
            {
                foreach (var behaviors in reaction.Behaviours)
                {
                    behaviorList.Add(behaviors.Clone(life));
                }
            }
            life.BuildReaction(stimulusTo, behaviorList.ToArray());
        }