Ejemplo n.º 1
0
        /// <summary>
        /// クリーチャーをセットする
        /// </summary>
        /// <param name="day"></param>
        /// <param name="cgm"></param>
        public void SetCreature(int day, CreatureGenerateModel cgm)
        {
            ExtraEditMod.m_debuglog = "SetCreature";

            if (day < 0)
            {
                ExtraEditMod.m_debuglog += "\n use Default";
                SetCreatureDefault(day, cgm);
                return;
            }

            var sefiraEnum = m_dayToSefiraEnumDic[day];
            KeyValuePair <SefiraEnum, int> kv = new KeyValuePair <SefiraEnum, int>(sefiraEnum, day % 5 + 1);

            if (m_creatureOlderDic.ContainsKey(kv))
            {
                bool result = false;
                foreach (var id in m_creatureOlderDic[kv])
                {
                    if (id != 0)
                    {
                        cgm.creature.Add(id);
                        ExtraEditMod.m_debuglog += "\n id" + id;
                        result = true;
                    }
                }
                if (result)
                {
                    return;
                }
            }
            ExtraEditMod.m_debuglog += "\n use Default";
            SetCreatureDefault(day, cgm);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// クリーチャーのデフォルトをセット
 /// </summary>
 /// <param name="day"></param>
 /// <param name="cgm"></param>
 public void SetCreatureDefault(int day, CreatureGenerateModel cgm)
 {
     if (cgm.commonAction != null)
     {
         cgm.commonAction.Exectue();
     }
     if (cgm.stop)
     {
         return;
     }
     if (cgm.door1.commonAction != null)
     {
         cgm.door1.commonAction.Exectue();
     }
     if (cgm.door2.commonAction != null)
     {
         cgm.door2.commonAction.Exectue();
     }
     if (cgm.door3.commonAction != null)
     {
         cgm.door3.commonAction.Exectue();
     }
     cgm.door1.SetCreature();
     cgm.door2.SetCreature();
     cgm.door3.SetCreature();
     if (cgm.door1.Creature != (long)-1)
     {
         cgm.creature.Add(cgm.door1.Creature);
     }
     if (cgm.door2.Creature != (long)-1)
     {
         cgm.creature.Add(cgm.door2.Creature);
     }
     if (cgm.door3.Creature != (long)-1)
     {
         cgm.creature.Add(cgm.door3.Creature);
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// クリーチャーをセットする
        /// </summary>
        /// <param name="day"></param>
        /// <param name="cgm"></param>
        public void SetCreature(object obj)
        {
            CreatureGenerateModel cgm = obj as CreatureGenerateModel;

            SetCreature(cgm.day, cgm);
        }