Esempio n. 1
0
 // Methods
 public void Draw(SpriteBatch spriteBatch, int x, int y, BlueprintState state = BlueprintState.Default)
 {
     if (Construct.Texture == null)
     {
         return;
     }
     spriteBatch.Draw(Construct.Texture,
                      new Rectangle(x * World.BlockSize, y * World.BlockSize, World.BlockSize * Construct.Dimensions.X, World.BlockSize * Construct.Dimensions.Y),
                      CalculateSourceRectangle(),
                      (job != null && job.IsReserved) ? Color.Orange : TintForState(state),
                      0.0f,
                      new Vector2(0),
                      SpriteEffects.None,
                      DrawLayer.Blueprint
                      );
 }
Esempio n. 2
0
        private Color TintForState(BlueprintState state)
        {
            if (job != null && !job.IsReachable)
            {
                return(new Color(1.0f, 0.0f, 0.0f, 0.8f));
            }

            switch (state)
            {
            case BlueprintState.Default:
                return(new Color(0.0f, 0.0f, 1.0f, 0.8f));

            case BlueprintState.Invalid:
                return(new Color(1.0f, 0.0f, 0.0f, 0.8f));

            case BlueprintState.Preview:
                return(new Color(0.0f, 1.0f, 0.0f, 0.8f));

            default:
                return(Color.White);
            }
        }
 public override void Damage(float damage)
 {
     BlueprintState.Damage(damage);
 }
 public override ICollection <ItemStack> GetDroppedItems()
 {
     return(BlueprintState.GetDroppedItems());
 }