コード例 #1
0
        public BasicItemInformation()
        {
            this.name             = "";
            this.description      = "";
            this.categoryName     = "";
            this.categoryColor    = new Color(0, 0, 0);
            this.price            = 0;
            this.edibility        = -300;
            this.canBeSetIndoors  = false;
            this.canBeSetOutdoors = false;

            this.animationManager = new AnimationManager();
            this.drawPosition     = Vector2.Zero;
            this.DrawColor        = Color.White;
            this.inventory        = new InventoryManager();
            this.lightManager     = new LightManager();

            this.facingDirection = Enums.Direction.Down;
            this.id                     = "";
            this.shakeTimer             = 0;
            this.EnergyManager          = new Energy.EnergyManager();
            this._alwaysDrawAbovePlayer = false;
            this.ColorManager           = new ColorManager(Enums.DyeBlendMode.Blend, 0.5f);
            this.fluidManager           = new FluidManagerV2();
        }
コード例 #2
0
        public static Color GetEnergyRemainingColor(Energy.EnergyManager Energy)
        {
            Color col = new Color();

            //ModCore.log("Energy is: " + this.energy.energyPercentRemaining);
            if (Energy.energyPercentRemaining > .75d)
            {
                col = Color.Green;
            }
            else if (Energy.energyPercentRemaining > .5d && Energy.energyPercentRemaining <= .75d)
            {
                col = Color.GreenYellow;
            }
            else if (Energy.energyPercentRemaining > .25d && Energy.energyPercentRemaining <= .5d)
            {
                col = Color.Yellow;
            }
            else if (Energy.energyPercentRemaining > .10d && Energy.energyPercentRemaining <= .25d)
            {
                col = Color.Orange;
            }
            else
            {
                col = Color.Red;
            }
            return(col);
        }
コード例 #3
0
        public BasicItemInformation(string name, string id, string description, string categoryName, Color categoryColor, int edibility, int fragility, bool isLamp, int price, bool canBeSetOutdoors, bool canBeSetIndoors, Texture2D texture, AnimationManager animationManager, Color drawColor, bool ignoreBoundingBox, InventoryManager Inventory, LightManager Lights, Energy.EnergyManager EnergyManager = null, bool AlwaysDrawAbovePlayer = false, NamedColor DyedColor = null, ColorManager ColorManager = null, FluidManagerV2 FluidManager = null)
        {
            this.name          = name;
            this.id            = id;
            this.description   = description;
            this.categoryName  = categoryName;
            this.categoryColor = categoryColor;
            this.price         = price;
            this.edibility     = edibility;

            this.canBeSetOutdoors = canBeSetOutdoors;
            this.canBeSetIndoors  = canBeSetIndoors;
            this.fragility        = fragility;
            this.isLamp           = isLamp;

            this.animationManager = animationManager;
            if (this.animationManager.IsNull)
            {
                this.animationManager = new AnimationManager(new Texture2DExtended(), new Animation(new Rectangle(0, 0, 16, 16)), false);
                this.animationManager.getExtendedTexture().texture = texture;
            }

            this.drawPosition      = Vector2.Zero;
            this.DrawColor         = drawColor;
            this.ignoreBoundingBox = ignoreBoundingBox;
            this.inventory         = Inventory ?? new InventoryManager();
            this.lightManager      = Lights ?? new LightManager();
            this.facingDirection   = Enums.Direction.Down;
            this.shakeTimer        = 0;

            this.EnergyManager         = EnergyManager ?? new Energy.EnergyManager();
            this.AlwaysDrawAbovePlayer = AlwaysDrawAbovePlayer;

            this.DyedColor    = DyedColor ?? new NamedColor("", new Color(0, 0, 0, 0));
            this.ColorManager = ColorManager ?? new ColorManager(Enums.DyeBlendMode.Blend, 0.5f);
            this.fluidManager = FluidManager ?? new FluidManagerV2();
        }