Beispiel #1
0
 public void DecideColors(MoldType mold1, MoldType mold2)
 {
     if (mold2 == MoldType.None)
     {
         if (mold1 == MoldType.Cyan)
         {
             sprite.sprite = cyanDoor;
         }
         else if (mold1 == MoldType.Pink)
         {
             sprite.sprite = pinkDoor;
         }
         else if (mold1 == MoldType.Purple)
         {
             sprite.sprite = purpleDoor;
         }
         else if (mold1 == MoldType.Yellow)
         {
             sprite.sprite = yellowDoor;
         }
     }
     else if (mold2 == MoldType.Cyan || mold2 == MoldType.Yellow &&
              mold1 == MoldType.Cyan || mold1 == MoldType.Yellow)
     {
         sprite.sprite = yellowCyanDoor;
     }
 }
        /// <summary>
        /// 根据模具号获得模具型号
        /// </summary>
        /// <param name="moldNR">模具号</param>
        /// <returns>模具型号</returns>
        public MoldType GetByMoldNR(string moldNR)
        {
            MoldType moldType = (from m in context.Mold
                                 where m.MoldNR.Equals(moldNR)
                                 select m.MoldType).Single();

            return(moldType);
        }
Beispiel #3
0
 private void Infect(MoldType type, Direction direction)
 {
     if (moldType != type)
     {
         hasSpread = false;
         moldiness = 0;
     }
     moldy    = true;
     moldType = type;
     moldManager.InfectedFrom(direction);
 }
Beispiel #4
0
 public void DecideColor(MoldType mold)
 {
     if (mold == MoldType.Purple)
     {
         sprite.sprite = PurpleApple;
     }
     else if (mold == MoldType.Cyan)
     {
         sprite.sprite = CyanFridge;
     }
     else if (mold == MoldType.Yellow)
     {
         sprite.sprite = YellowTrashBin;
     }
 }
Beispiel #5
0
        /// <summary>
        /// Mold constructor. Pass as many attrbutes as needed for the specified Mold Type.
        /// </summary>
        public Mold(MoldType type, object attribute1 = null, object attribute2 = null, object attribute3 = null, object attribute4 = null)
        {
            Type = type;

            if (attribute1 == null)
            {
                return;
            }

            Attributes = new List <string>();

            foreach (var attr in new[] { attribute1, attribute2, attribute3, attribute4 })
            {
                if (attr == null)
                {
                    return;
                }
                else
                {
                    Attributes.Add(attr.ToString());
                }
            }
        }
Beispiel #6
0
 public void ChangeToYellow()
 {
     chosenType = MoldType.Yellow;
 }
Beispiel #7
0
 public void ChangeToCyan()
 {
     chosenType = MoldType.Cyan;
 }
Beispiel #8
0
 public void ChangeToPurple()
 {
     chosenType = MoldType.Purple;
 }
Beispiel #9
0
 public void ChangeToPink()
 {
     chosenType = MoldType.Pink;
 }
        /// <summary>
        /// 根据模具型号号获得模具型号
        /// </summary>
        /// <param name="moldTypeId">模具型号号</param>
        /// <returns>模具型号</returns>
        public MoldType GetById(string moldTypeId)
        {
            MoldType moldtype = context.MoldType.Single(type => type.MoldTypeID.Equals(moldTypeId));

            return(moldtype);
        }
        /// <summary>
        /// 根据模具型号号删除模具型号
        /// </summary>
        /// <param name="moldTypeId">模具型号号</param>
        public void DeleteById(string moldTypeId)
        {
            MoldType moldtype = GetById(moldTypeId);

            context.MoldType.DeleteOnSubmit(moldtype);
        }
 /// <summary>
 /// 新建模具型号
 /// </summary>
 /// <param name="moldType">模具型号</param>
 public void Add(MoldType moldType)
 {
     context.MoldType.InsertOnSubmit(moldType);
 }