예제 #1
0
        FormattedText secondSign; //only used by certain decorations

        #endregion Fields

        #region Constructors

        public DecorationDrawing(EquationContainer parent, DecorationType decorationType)
            : base(parent)
        {
            this.decorationType = decorationType;
            IsStatic = true;
            CreateDecorations();
            DetermineHeight();
        }
예제 #2
0
        public Decoration(DecorationType type, int X, int Y) {
            this.type = type;
            this.X = X;
            this.Y = Y;
            Width = 32;
            Height = 32;
            rand = new Random();
            timer = new Timer();

            timer.Enabled = true;
            timer.Interval = rand.Next(10, 30);
            timer.Tick += new EventHandler(Loop);

            switch(type) {

                case DecorationType.Blue_Fish:
                    image = Image.FromFile(Path.Combine(Environment.CurrentDirectory, "Decoration/BlueFish1.png"));
                    image2 = Image.FromFile(Path.Combine(Environment.CurrentDirectory, "Decoration/BlueFish2.png"));
                    break;

                case DecorationType.FireBall:
                    image = Image.FromFile(Path.Combine(Environment.CurrentDirectory, "Decoration/Fireball.png"));
                    YCounter = -70;
                    break;

                case DecorationType.Ghost:
                    image = Image.FromFile(Path.Combine(Environment.CurrentDirectory, "Decoration/GhostL.png"));
                    image2 = Image.FromFile(Path.Combine(Environment.CurrentDirectory, "Decoration/GhostR.png"));

                    break;

                case DecorationType.Mole:
                    image = Image.FromFile(Path.Combine(Environment.CurrentDirectory, "Decoration/Mole.png"));

                    break;

                case DecorationType.Piranha:
                    image = Image.FromFile(Path.Combine(Environment.CurrentDirectory, "Decoration/Piranha1.png"));
                    image2 = Image.FromFile(Path.Combine(Environment.CurrentDirectory, "Decoration/Piranha2.png"));

                    break;

                case DecorationType.Red_Fish:
                    image = Image.FromFile(Path.Combine(Environment.CurrentDirectory, "Decoration/RedFish1.png"));
                    image2 = Image.FromFile(Path.Combine(Environment.CurrentDirectory, "Decoration/RedFish2.png"));
                    break;

                case DecorationType.Star:
                    image = Image.FromFile(Path.Combine(Environment.CurrentDirectory, "Decoration/Star.png"));
                    break;

            }

        }
예제 #3
0
 public DecorationControl(DecorationType type, Control decoratedControl)
 {
     this.DecorationType = type;
     this.DecoratedControl = decoratedControl;
     decoratedControl.VisibleChanged += new EventHandler(this.control_VisibleChanged);
     decoratedControl.ParentChanged += new EventHandler(this.control_VisibleChanged);
     decoratedControl.LocationChanged += new EventHandler(this.control_VisibleChanged);
     decoratedControl.Paint += new PaintEventHandler(this.decoratedControl_Paint);
     base.SetStyle(ControlStyles.Selectable, false);
     base.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);
     this.InitPadding();
     this.tm = new System.Windows.Forms.Timer();
     this.tm.Interval = 100;
     this.tm.Tick += new EventHandler(this.tm_Tick);
     this.tm.Enabled = true;
 }
예제 #4
0
        public void SetDecoration(Control control, DecorationType decoration)
        {
            var wrapper = DecorationByControls.ContainsKey(control) ? DecorationByControls[control] : null;

            if (decoration == DecorationType.None)
            {
                if (wrapper != null)
                {
                    wrapper.Dispose();
                }
                DecorationByControls.Remove(control);
            }
            else
            {
                if (wrapper == null)
                {
                    wrapper = new DecorationControl(decoration, control);
                }
                wrapper.DecorationType        = decoration;
                DecorationByControls[control] = wrapper;
            }
        }
예제 #5
0
        public void SetDecoration(Control control, DecorationType decoration)
        {
            DecorationControl control2 = this.DecorationByControls.ContainsKey(control) ? this.DecorationByControls[control] : null;

            if (decoration == DecorationType.None)
            {
                if (control2 != null)
                {
                    control2.Dispose();
                }
                this.DecorationByControls.Remove(control);
            }
            else
            {
                if (control2 == null)
                {
                    control2 = new DecorationControl(decoration, control);
                }
                control2.DecorationType            = decoration;
                this.DecorationByControls[control] = control2;
            }
        }
예제 #6
0
        private static LineDecorationModel CreateDecorator(ItemInfo itemInfo, DecorationType decoratorElementType, DecorationPool <LineDecorationModel> displayData, IDecorationPresenter <LineDecorationModel> owner)
        {
            if (owner == null)
            {
                return(null);
            }

            var lineDecorator = displayData.GetRecycledElement();

            if (lineDecorator == null)
            {
                lineDecorator           = new LineDecorationModel();
                lineDecorator.Container = owner.GenerateContainerForDecorator();
            }

            lineDecorator.ItemInfo = itemInfo;

            owner.ApplyDecoratorProperties(lineDecorator, decoratorElementType);

            displayData.AddToDisplayedElements(lineDecorator);

            return(lineDecorator);
        }
예제 #7
0
        public DecorationControl(DecorationType type, Control decoratedControl)
        {
            this.Font = CCWin.Localization.Localizer.DefaultFont;
            this.DecorationType = type;
            this.DecoratedControl = decoratedControl;

            decoratedControl.VisibleChanged += new EventHandler(control_VisibleChanged);
            decoratedControl.ParentChanged += new EventHandler(control_VisibleChanged);
            decoratedControl.LocationChanged += new EventHandler(control_VisibleChanged);

            decoratedControl.Paint += new PaintEventHandler(decoratedControl_Paint);

            SetStyle(ControlStyles.Selectable, false);
            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true);

            //BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            InitPadding();

            tm = new Timer();
            tm.Interval = 100;
            tm.Tick += new EventHandler(tm_Tick);
            tm.Enabled = true;
        }
예제 #8
0
        public DecorationControl(DecorationType type, Control decoratedControl)
        {
            this.Font             = CCWin.Localization.Localizer.DefaultFont;
            this.DecorationType   = type;
            this.DecoratedControl = decoratedControl;

            decoratedControl.VisibleChanged  += new EventHandler(control_VisibleChanged);
            decoratedControl.ParentChanged   += new EventHandler(control_VisibleChanged);
            decoratedControl.LocationChanged += new EventHandler(control_VisibleChanged);

            decoratedControl.Paint += new PaintEventHandler(decoratedControl_Paint);

            SetStyle(ControlStyles.Selectable, false);
            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true);

            //BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            InitPadding();

            tm          = new Timer();
            tm.Interval = 100;
            tm.Tick    += new EventHandler(tm_Tick);
            tm.Enabled  = true;
        }
예제 #9
0
        public DecorationType[] GetStyles()
        {
            Console.WriteLine("Wybierz kolejność dekoracji do zastosowania: [r]amka, [m]argines, [p]odkreślenie, [n]awiasy, [b]rak");

            var userStylesSequence       = Console.ReadLine();
            int userStylesSequenceLength = userStylesSequence.Length;

            DecorationType[] tableStylesSequence = new DecorationType[userStylesSequenceLength];

            for (int i = 0; i < userStylesSequenceLength; i++)
            {
                switch (userStylesSequence.ElementAt(i))
                {
                case 'r':
                    tableStylesSequence[i] = DecorationType.Frame;
                    break;

                case 'm':
                    tableStylesSequence[i] = DecorationType.Margin;
                    break;

                case 'p':
                    tableStylesSequence[i] = DecorationType.Underline;
                    break;

                case 'n':
                    tableStylesSequence[i] = DecorationType.Bracket;
                    break;

                default:
                    tableStylesSequence[i] = DecorationType.Null;
                    break;
                }
            }

            return(tableStylesSequence);
        }
예제 #10
0
        internal void Load(DecorationType type)
        {
            CustomDecorationsData pack;

            switch (type)
            {
            case DecorationType.Grass:
                pack = AvailablePacks.Find(p => p.Name == Settings.SelectedGrassPack);
                break;

            case DecorationType.Fertile:
                pack = AvailablePacks.Find(p => p.Name == Settings.SelectedFertilePack);
                break;

            default:
                pack = AvailablePacks.Find(p => p.Name == Settings.SelectedCliffPack);
                break;
            }

            if (pack != null)
            {
                UnityMainThreadDispatcher.Instance().Enqueue(LoadResources(pack, type));
            }
        }
예제 #11
0
        internal void Load1(DecorationType type)
        {
            CustomDecorationsData pack;

            switch (type)
            {
            case DecorationType.Grass:
                pack = AvailablePacks.Find(p => p.Name == Settings.SelectedGrassPack);
                break;

            case DecorationType.Fertile:
                pack = AvailablePacks.Find(p => p.Name == Settings.SelectedFertilePack);
                break;

            default:
                pack = AvailablePacks.Find(p => p.Name == Settings.SelectedCliffPack);
                break;
            }

            if (pack != null)
            {
                LoadResources(pack, type);
            }
        }
예제 #12
0
 public void SetRecentPurchaseData(DecorationType recentPurchaseType, int recentPurchaseId)
 {
     mostRecentPurchaseType = recentPurchaseType;
     mostRecentPurchaseId   = recentPurchaseId;
 }
예제 #13
0
 public void CreateDecoration(DecorationType dt, Vector3 positon, float scale, Vector3 rotation)
 {
     gameWorld.CreateDecoration(dt, positon, scale, rotation);
 }
예제 #14
0
 void IDecorationPresenter <LineDecorationModel> .ApplyDecoratorProperties(LineDecorationModel lineDecorator, DecorationType decoratorElementType)
 {
     if (this.owner != null)
     {
         this.owner.ApplyLineDecoratorProperties(lineDecorator, decoratorElementType);
     }
 }
예제 #15
0
 public DefinedDecorations()
 {
     None   = new DecorationType(0, "", 0, 0);
     Shelf  = new DecorationType(1, "decoration.shelf", 0, 1);
     Window = new DecorationType(2, "decoration.window", 0, 0);
 }
예제 #16
0
        static Vector2 GetDecoratorVertex(DecorationType decorationType, Size size)
        {
            switch (decorationType)
            {
                default:
                case DecorationType.DownsideTriangle:
                    return new Vector2(size.Width / 2.0f - DefaultTriangleSideLength / 2,
                                       (size.Height - (float)(DefaultTriangleSideLength / 2 * Math.Sqrt(3))) / 2);

                case DecorationType.Cross:
                    return new Vector2(size.Width / 2.0f - DefaultCrossWidth / 2,
                                       DefaultCrossPaddingY);
            }
        }
예제 #17
0
 public void SetDecoration(Control control, DecorationType decoration)
 {
     DecorationControl control2 = this.DecorationByControls.ContainsKey(control) ? this.DecorationByControls[control] : null;
     if (decoration == DecorationType.None)
     {
         if (control2 != null)
         {
             control2.Dispose();
         }
         this.DecorationByControls.Remove(control);
     }
     else
     {
         if (control2 == null)
         {
             control2 = new DecorationControl(decoration, control);
         }
         control2.DecorationType = decoration;
         this.DecorationByControls[control] = control2;
     }
 }
예제 #18
0
 private void GenerateColumnDecoratorForGroup(ItemInfo itemInfo, DecorationType decoratorElementType)
 {
     GenerateDecorator(itemInfo.Id, itemInfo, decoratorElementType, this.columnLinesElementsPool, this.displayedColumnDecorationsMap, this.decorationPresenter);
 }
 public static void RegisterProperty(string propertyName, DecorationType type)
 {
     Function.Call(Hash.DECOR_REGISTER, propertyName, (int)type);
 }
예제 #20
0
파일: Game1.cs 프로젝트: travis134/Palette
        private Texture2D DecorationTexture(DecorationType decorationType)
        {
            Texture2D output = new Texture2D(GraphicsDevice, BLOCK_SIZE.X, BLOCK_SIZE.Y);

            Color[] colorData = new Color[(int)(BLOCK_SIZE.X * BLOCK_SIZE.Y)];

            for (int i = 0; i < colorData.Length; i++)
            {
                int x = i % BLOCK_SIZE.X;
                int y = i / BLOCK_SIZE.Y;

                switch (decorationType)
                {
                    case DecorationType.None:
                        colorData[i] = Color.Transparent;
                        break;
                    case DecorationType.Player:
                        if (x - 1 >= BLOCK_SIZE.X / 5 && x + 1 < BLOCK_SIZE.X - (BLOCK_SIZE.X / 5) && y - 1 >= BLOCK_SIZE.Y / 5 && y + 1 < BLOCK_SIZE.Y - (BLOCK_SIZE.Y / 5))
                        {
                            colorData[i] = Color.Black;
                        }
                        else
                        {
                            colorData[i] = Color.Transparent;
                        }
                        break;
                }
            }

            output.SetData<Color>(colorData);

            return output;
        }
예제 #21
0
 public void CreateDecoration(DecorationType dT, Vector3 position)
 {
     gameWorld.CreateDecoration(dT, position);
 }
예제 #22
0
 public static void RegisterProperty(string propertyName, DecorationType type)
 {
     DecorRegister(propertyName, (int)type);
 }
예제 #23
0
 public static IDecoration GetDecoration(DecorationType type)
 {
     return(map[(byte)type]);
 }
 void IDecorationPresenter <SelectionRegionModel> .ApplyDecoratorProperties(SelectionRegionModel decorator, DecorationType decoratorElementType)
 {
     if (this.owner != null)
     {
         this.owner.ApplyDecoratorProperties(decorator, decoratorElementType);
     }
 }
 bool IDecorationPresenter <SelectionRegionModel> .HasDecorations(DecorationType decoratorElementType, ItemInfo itemInfo)
 {
     return(true);
 }
예제 #26
0
 public DecorationAttribute(DecorationType decoration, float frequency, int r, int g, int b)
 {
     _decoration = decoration;
     _frequency  = frequency;
     _color      = new Color(r, g, b);
 }
예제 #27
0
 public void PurchaseDecoration(int decorationDefinitionId, DecorationType type, int?count, IIglooCatalogPurchaseErrorHandler errorHandler)
 {
     PurchaseDecoration(new DecorationId(decorationDefinitionId, type), count, errorHandler);
 }
예제 #28
0
 public DecorationId(int definitionId, DecorationType type, long?customId)
 {
     this.definitionId = definitionId;
     this.type         = type;
     this.customId     = customId;
 }
예제 #29
0
 public QACreateDecorationOperation(int definitionId, DecorationType type, int count)
 {
     DefinitionId = definitionId;
     Count        = count;
     Type         = (int)type;
 }
예제 #30
0
 public void DeleteDecoration(int decorationDefinitionId, DecorationType type)
 {
     DeleteDecoration(new DecorationId(decorationDefinitionId, type));
 }
예제 #31
0
 public DecorationId(int definitionId, DecorationType type)
     : this(definitionId, type, null)
 {
 }
        public static DecorationLayoutData.DefinitionType ToDecorationLayoutDataDefinitionType(DecorationType layoutType)
        {
            switch (layoutType)
            {
            case DecorationType.Decoration:
                return(DecorationLayoutData.DefinitionType.Decoration);

            case DecorationType.Structure:
                return(DecorationLayoutData.DefinitionType.Structure);

            default:
                Log.LogErrorFormatted(typeof(IglooMediator), "Unknown decoration type {0}", layoutType);
                return(DecorationLayoutData.DefinitionType.Decoration);
            }
        }
예제 #33
0
 public void SetDecoration(Control control, DecorationType decoration)
 {
     var wrapper = DecorationByControls.ContainsKey(control) ? DecorationByControls[control] : null;
     if (decoration == DecorationType.None)
     {
         if (wrapper!=null)
             wrapper.Dispose();
         DecorationByControls.Remove(control);
     }
     else
     {
         if (wrapper == null)
             wrapper = new DecorationControl(decoration, control);
         wrapper.DecorationType = decoration;
         DecorationByControls[control] = wrapper;
     }
 }
예제 #34
0
 public async Task AddTypeAsync(DecorationType decorationType)
 {
     await _typeRepository.CreateAsync(decorationType);
 }
예제 #35
0
 internal abstract void ApplyLineDecoratorProperties(LineDecorationModel lineDecorator, DecorationType decoratorElementType);
예제 #36
0
    public APICall <QACreateDecorationOperation> QaCreateDecoration(int definitionId, DecorationType type, int?count)
    {
        if (!count.HasValue)
        {
            count = 1;
        }
        QACreateDecorationOperation operation = new QACreateDecorationOperation(definitionId, type, count.Value);

        return(new APICall <QACreateDecorationOperation>(clubPenguinClient, operation));
    }
예제 #37
0
 private void Instil(ContentManager content, DecorationType itemType) => this.item = (Placeable) new DecorationFactory(content).GetDecoration(itemType, 0.0f, 0.0f, false, false, false, false);
예제 #38
0
 internal abstract void ApplyDecoratorProperties(SelectionRegionModel decorator, DecorationType decoratorElementType);