Beispiel #1
0
        /// <summary>
        /// Makes a ornament for the Shape
        /// </summary>
        /// <param name="shape">the given shape</param>
        /// <returns>the shape or the top ornament</returns>
        private GodShape MakeOrnaments(BaseShape shape)
        {
            List <Ornament> ornaments = new List <Ornament>();

            if (_comboBoxLinkers.Count != 0)
            {
                for (int i = 0; i < _comboBoxLinkers.Count; i++)
                {
                    if (i == 0)
                    {
                        shape.HasDeco = true;
                        Ornament ornament = new Ornament(shape);
                        ornaments.Add(ornament);
                    }
                    else
                    {
                        var      previousOrnament = ornaments[i - 1];
                        Ornament ornament         = new Ornament(previousOrnament);
                        ornaments.Add(ornament);
                    }
                    ornaments[i].Position = _comboBoxLinkers[i].PositionString;
                    ornaments[i].Name     = _comboBoxLinkers[i].TextBoxName;
                }
                _comboBoxLinkers.Clear();
                return(ornaments[^ 1]);
Beispiel #2
0
    public void CheckTaskCompletion() //Made By Simon & Daniel
    {
        if (body == null || body.Head == null || dirtLayerList.Count != maxAmountOfDirtLayers)
        {
            return;
        }

        List <OrnamentType> ornamentType = new List <OrnamentType>();

        foreach (OrnamentPlacement placement in ornamentPlacements)
        {
            Ornament ornament = placement.GetPlacedOrnament();
            if (ornament)
            {
                ornamentType.Add(ornament.GetOrnamentType());
            }
        }

        Head head = body.Head;

        if (head != null)
        {
            foreach (Task task in FindObjectOfType <TaskManager>().tasks)
            {
                if (task.CheckTask(head.GetHeadType(), body.GetBodyType(), ornamentType, body.GetTreatmentType(), head.GetTreatmentType()))
                {
                    Debug.Log("TaskGrave: FINISHED TASK, AWW YEAH");
                    ResetGrave();
                    return;
                }
            }
        }
    }
Beispiel #3
0
 public StaffOrnament(string texture, int originX, int originY, string suffix, bool front = true, float mana = 1f, float dpsModifier = 1f,
                      float speedModifier = 1f, float knockBack = 0f, int critBonus = 0, int repetitions = 0)
 {
     Type = Ornament.Count;
     if (Main.netMode != NetmodeID.Server)
     {
         if (texture != null)
         {
             Texture = ModLoader.GetMod(Constants.ModName).GetTexture("Content/GFX/Items/Ornaments/" + texture);
         }
     }
     Origin        = new Vector2(originX, originY);
     DpsModifier   = dpsModifier;
     SpeedModifier = speedModifier;
     KnockBack     = knockBack;
     CritBonus     = critBonus;
     Suffix        = suffix;
     Mana          = mana;
     Front         = front;
     Repetitions   = repetitions;
     if (!Ornament.ContainsKey(Type))
     {
         Ornament.Add(Type, this);
     }
 }
    public static bool ReturnOrnament(Ornament ornament, bool skipRemoveFromList = false)
    {
        if (ornament)
        {
            switch (ornament.GetOrnamentType())
            {
            case OrnamentType.Flower:
                FlowerPool.GetInstance().ReturnToPool(ornament.gameObject, skipRemoveFromList);
                break;

            case OrnamentType.Candle:
                CandlePool.GetInstance().ReturnToPool(ornament.gameObject, skipRemoveFromList);
                break;

            case OrnamentType.Heart:
                HeartPool.GetInstance().ReturnToPool(ornament.gameObject, skipRemoveFromList);
                break;

            case OrnamentType.Statue:;
                StatuePool.GetInstance().ReturnToPool(ornament.gameObject, skipRemoveFromList);
                break;

            default:
                Debug.LogError("Something Went Wrong");
                break;
            }
            return(true);
        }
        else
        {
            return(false);
        }
    }
Beispiel #5
0
        public string InsertDecoration(string aquariumName, string decorationType)
        {
            //Ornament Plant
            if (decorationType != "Ornament" && decorationType != "Plant")
            {
                throw new InvalidOperationException($"There isn't a decoration of type {decorationType}.");
            }

            var aquarium = this.aquariums.FirstOrDefault(x => x.Name == aquariumName);

            IDecoration decoration = null;

            switch (decorationType)
            {
            case "Ornament":
                decoration = new Ornament();
                break;

            case "Plant":
                decoration = new Plant();
                break;
            }

            aquarium.AddDecoration(decoration);
            this.decorations.Remove(decoration);

            return($"Successfully added {decorationType} to {aquariumName}.");
        }
        /// <summary>
        /// moves the ornaments
        /// </summary>
        /// <param name="ornament">the given ornament</param>
        public void VisitOrnament(Ornament ornament)
        {
            ornament.GetComponent().Accept(this);
            Vector x = ornament.GetVector(ornament.Position);

            Canvas.SetTop(ornament.TextBlock, x.Y);
            Canvas.SetLeft(ornament.TextBlock, x.X);
        }
Beispiel #7
0
    protected override void ReturnObject(GameObject pickupObject)
    {
        Ornament ornament = pickupObject.GetComponent <Ornament>();

        if (ornament.ActiveHand)
        {
            ornament.ActiveHand.Drop();
        }
        ornament.ReturnToPool();
    }
        public void VisitOrnament(Ornament ornament)
        {
            ornament.TextBlock.Text = ornament.Name.ToString();
            Vector x = ornament.GetVector(ornament.Position);

            Canvas.SetTop(ornament.TextBlock, x.Y);
            Canvas.SetLeft(ornament.TextBlock, x.X);
            ornament.GetComponent().Accept(this);
            MainWindow.AppWindow.PutOnScreen(ornament.TextBlock);
        }
Beispiel #9
0
        /// <summary>
        /// Creates an ornament from string line and adds it to given shape
        /// </summary>
        /// <returns>Ornament this method created</returns>
        private Ornament CreateOrnament(string line, Shape.Shape shape)
        {
            line.Trim('\t');
            string[] words = line.Split(' ');
            Ornament o     = new Ornament(words[2].Trim('\"'), OrnamentHelper.GetOrnamentOrientationFromString(words[1]), shape);
            var      cmd   = new AddOrnament(
                shape,
                o);

            cmd.Execute();
            return(o);
        }
Beispiel #10
0
        public void AssignFields(object d2oObject)
        {
            Ornament ornament = (Ornament)d2oObject;

            this.Id      = ornament.id;
            this.NameId  = ornament.nameId;
            this.Visible = ornament.visible;
            this.AssetId = ornament.assetId;
            this.IconId  = ornament.iconId;
            this.Rarity  = ornament.rarity;
            this.Order   = ornament.order;
        }
 protected override GameObject FindOldestAvailable()
 {
     GameObject objectToReturn = usedObjects[0];
     for (int i = 0; i < usedObjects.Count; i++)
     {
         Ornament ornament = usedObjects[i].GetComponent<Ornament>();
         if (ornament && !ornament.ActiveHand && !ornament.Placement)
         {
             objectToReturn = usedObjects[i];
             break;
         }
     }
     return objectToReturn;
 }
Beispiel #12
0
        private IDecoration GetDecorationOfCurrentType(string decorationType)
        {
            IDecoration decoration = null;

            if (decorationType == "Ornament")
            {
                decoration = new Ornament();
            }
            else if (decorationType == "Plant")
            {
                decoration = new Plant();
            }
            return(decoration);
        }
Beispiel #13
0
 public string AddDecoration(string decorationType)
 {
     IDecoration decoration;
     if (decorationType == nameof(Ornament))
     {
         decoration = new Ornament();
     }
     else if (decorationType == nameof(Plant))
     {
         decoration = new Plant();
     }
     else
     {
         throw new InvalidOperationException(ExceptionMessages.InvalidDecorationType);
     }
     decorations.Add(decoration);
     return string.Format(OutputMessages.SuccessfullyAdded, decorationType);
 }
Beispiel #14
0
        public string AddDecoration(string decorationType)
        {
            if (decorationType != "Plant" && decorationType != "Ornament")
            {
                throw new InvalidOperationException("Invalid decoration type.");
            }
            IDecoration currDecor;

            if (decorationType == "Plant")
            {
                currDecor = new Plant();
            }
            else
            {
                currDecor = new Ornament();
            }
            this.decorRepo.Add(currDecor);
            return($"Successfully added {currDecor.GetType().Name}.");
        }
Beispiel #15
0
 public string AddDecoration(string decorationType)
 {
     if (decorationType != "Ornament" && decorationType != "Plant")
     {
         throw new InvalidOperationException(string.Format(ExceptionMessages.InvalidDecorationType));
     }
     if (decorationType == "Ornament")
     {
         var newFresh = new Ornament();
         this.decorations.Add(newFresh);
         return(string.Format(OutputMessages.SuccessfullyAdded, newFresh.GetType().Name));
     }
     else
     {
         var newFresh = new Plant();
         this.decorations.Add(newFresh);
         return(string.Format(OutputMessages.SuccessfullyAdded, newFresh.GetType().Name));
     }
 }
Beispiel #16
0
        public string AddDecoration(string decorationType)
        {
            if (decorationType == "Ornament")
            {
                IDecoration decoration = new Ornament();
                this.decorations.Add(decoration);
            }
            else if (decorationType == "Plant")
            {
                IDecoration decoration = new Plant();
                this.decorations.Add(decoration);
            }
            else
            {
                throw new InvalidOperationException(ExceptionMessages.InexistentDecoration);
            }

            return(string.Format(OutputMessages.SuccessfullyAdded, decorationType));
        }
Beispiel #17
0
        public string AddDecoration(string decorationType)
        {
            if (decorationType != "Ornament" && decorationType != "Plant")
            {
                throw new InvalidOperationException(ExceptionMessages.InvalidDecorationType);
            }
            IDecoration decoration = null;

            if (decorationType == "Ornament")
            {
                decoration = new Ornament();
            }
            else if (decorationType == "Plant")
            {
                decoration = new Plant();
            }
            decorations.Add(decoration);
            return(String.Format(OutputMessages.SuccessfullyAdded, decorationType));
        }
        public string AddDecoration(string decorationType)
        {
            if (decorationType != "Plant" && decorationType != "Ornament")
            {
                throw new InvalidOperationException("Invalid decoration type.");
            }
            IDecoration decoration = null;

            if (decorationType == "Plant")
            {
                decoration = new Plant();
            }
            else if (decorationType == "Ornament")
            {
                decoration = new Ornament();
            }
            this.decorations.Add(decoration);
            return($"Successfully added {decorationType}.");
        }
Beispiel #19
0
 public string AddDecoration(string decorationType)
 {
     if (decorationType == "Ornament")
     {
         IDecoration currentDecoration = new Ornament();
         decorations.Add(currentDecoration);
         return($"Successfully added {decorationType}.");
     }
     else if (decorationType == "Plant")
     {
         IDecoration currentDecoration = new Plant();
         decorations.Add(currentDecoration);
         return($"Successfully added {decorationType}.");
     }
     else
     {
         throw new InvalidOperationException(ExceptionMessages.InvalidDecorationType);
     }
 }
        public string AddDecoration(string decorationType)
        {
            IDecoration decoration;

            switch (decorationType)
            {
            case "Ornament":
                decoration = new Ornament();
                break;

            case "Plant":
                decoration = new Plant();
                break;

            default:
                throw new InvalidOperationException(ExceptionMessages.InvalidDecorationType);
            }
            decorationRepository.Add(decoration);
            return(string.Format(OutputMessages.SuccessfullyAdded, decorationType));
        }
Beispiel #21
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.CompareTag("Interactable"))
        {
            TaskCard taskCard;
            if (taskCard = other.GetComponent <TaskCard>())
            {
                taskCard.StartReturnToBoxCoroutine();
            }

            else
            {
                Ornament ornament = other.GetComponent <Ornament>();
                if (!PoolManager.ReturnOrnament(ornament))
                {
                    Destroy(other.gameObject);
                }
            }
        }
    }
Beispiel #22
0
        public string AddDecoration(string decorationType)
        {
            IDecoration decoration = null;

            if (decorationType == nameof(Ornament))
            {
                decoration = new Ornament();
            }
            else if (decorationType == nameof(Plant))
            {
                decoration = new Plant();
            }
            else
            {
                throw new InvalidOperationException("Invalid decoration type.");
            }

            decorationRepository.Add(decoration);
            return($"Successfully added {decorationType}.");
        }
Beispiel #23
0
        public string AddDecoration(string decorationType)
        {
            IDecoration currentDecoration;

            switch (decorationType)
            {
            case "Ornament":
                currentDecoration = new Ornament();
                break;

            case "Plant":
                currentDecoration = new Plant();
                break;

            default:
                throw new InvalidOperationException(ExceptionMessages.InvalidDecorationType);
            }

            this.decorations.Add(currentDecoration);
            return($"Successfully added {currentDecoration.GetType().Name}.");
        }
        public string AddDecoration(string decorationType)
        {
            IDecoration decoration;

            if (decorationType == "Ornament")
            {
                decoration = new Ornament();
            }
            else if (decorationType == "Plant")
            {
                decoration = new Plant();
            }
            else
            {
                throw new InvalidOperationException(ExceptionMessages.InvalidDecorationType);
            }

            this.decorationRepository.Add(decoration);

            return(String.Format(OutputMessages.SuccessfullyAdded, decorationType));
        }
        public string AddDecoration(string decorationType)
        {
            IDecoration decoration = null;

            switch (decorationType)
            {
            case "Ornament":
                decoration = new Ornament();
                break;

            case "Plant":
                decoration = new Plant();
                break;

            default:
                throw new InvalidOperationException("Invalid decoration type.");
            }

            this.decorations.Add(decoration);
            return($"Successfully added {decorationType}.");
        }
Beispiel #26
0
        public string AddDecoration(string decorationType)
        {
            IDecoration dec = null;

            if (decorationType == "Ornament")
            {
                dec = new Ornament();
            }
            if (decorationType == "Plant")
            {
                dec = new Plant();
            }

            if (dec == null)
            {
                throw new InvalidOperationException(ExceptionMessages.InvalidDecorationType);
            }

            decorations.Add(dec);

            return($"Successfully added {decorationType}.");
        }
Beispiel #27
0
        public string AddDecoration(string decorationType)
        {
            Decoration decoration;

            if (decorationType == nameof(Plant))
            {
                decoration = new Plant();
            }
            else if (decorationType == nameof(Ornament))
            {
                decoration = new Ornament();
            }
            else
            {
                throw new InvalidOperationException(ExceptionMessages.InvalidDecorationType);
            }

            this.decorationRepository.Add(decoration);

            var result = string.Format(OutputMessages.SuccessfullyAdded, decorationType);

            return(result);
        }
Beispiel #28
0
        public object Create(params object[] value)
        {
            IDecoration decoration = null;

            string decorationType = value[0].ToString();


            if (decorationType == "Ornament" || decorationType == "Plant")
            {
                if (decorationType == "Ornament")
                {
                    decoration = new Ornament();
                }

                if (decorationType == "Plant")
                {
                    decoration = new Plant();
                }

                return(decoration);
            }
            throw new ArgumentException(ExceptionMessages.InvalidDecorationType);
        }
Beispiel #29
0
        public string AddDecoration(string decorationType)
        {
            var message = string.Empty;

            if (decorationType == "Ornament")
            {
                message = string.Format(OutputMessages.SuccessfullyAdded, decorationType);
                var decoration = new Ornament();
                this.decorations.Add(decoration);
            }
            else if (decorationType == "Plant")
            {
                message = string.Format(OutputMessages.SuccessfullyAdded, decorationType);
                var decoration = new Plant();
                this.decorations.Add(decoration);
            }
            else
            {
                throw new InvalidOperationException(ExceptionMessages.InvalidDecorationType);
            }

            return(message);
        }
Beispiel #30
0
        public string AddDecoration(string decorationType)
        {
            IDecoration decoration = null;
            string      result     = String.Empty;

            if (decorationType == "Ornament")
            {
                decoration = new Ornament();
            }
            else if (decorationType == "Plant")
            {
                decoration = new Plant();
            }
            else
            {
                throw new InvalidOperationException(ExceptionMessages.InvalidDecorationType);
            }

            this.decorations.Add(decoration);
            result = string.Format(OutputMessages.SuccessfullyAdded, decorationType);

            return(result);
        }