Exemplo n.º 1
0
    public void createNewBlock(color col)
    {
        arenaBlock arena = null;

        if (blockCount() < 32) while (arena == null || arena.blocked) arena = gameManager.ArenaManager().arenaBlock[Random.Range(0, 39)];
        else
        {
            for (int i = 0; i < 40; ++i)
            {
                arena = gameManager.ArenaManager().arenaBlock[i];
                if (!arena.blocked) break;
            }
        }

        if (!arena.blocked)
        {
            GameObject newBlock = Instantiate(blockPrefab) as GameObject;
            newBlock.name = blockIndex.ToString(); //Change name
            newBlock.GetComponent<NavMeshAgent>().enabled = false; //Turn off Navmesh Agent

            //Set position
            Vector3 pos = arena.transform.position;
            pos.y = 0.4166f;
            newBlock.transform.position = pos;
            newBlock.GetComponent<blockController>().navTarget = arena.transform.gameObject;

            newBlock.GetComponent<blockController>().blockColor = col; //Set color
            newBlock.transform.parent = gameObject.transform; //Set as child
            newBlock.GetComponent<Animator>().SetTrigger("newBlock"); //Run animation

            ++blockIndex;
        }
    }
Exemplo n.º 2
0
 public Auto(string carBrand, string type, short amountOfDoors, color carColor, float fuelConsumption)
 {
     this.carBrand = carBrand;
     this.type = type;
     this.amountOfDoors = amountOfDoors;
     this.carColor = carColor;
     this.fuelConsumption = fuelConsumption;
 }
Exemplo n.º 3
0
 public override void ClearToColor(color c)
 {
     Size2I size = Graphics.DeviceContext.SizeInPixels;
     //Graphics.UseDefaultPen();
     //Graphics.SetDefaultPenColor(GetColorref(c));
     Graphics.UseDefaultBrush();
     Graphics.SetDefaultBrushColor(GetColorref(c));
     Graphics.DeviceContext.Rectangle(0, 0, size.width, size.height);
 }
 private void InitParameters()
 {
     shift = 20;
     trackBarColor = new color();
     boundOfValuesOfMatrix = new Bound();
     boundOfValuesOfBlocks = new Bound();
 }
Exemplo n.º 5
0
 public static void enum_test(color c, Foo.speed s) {
   examplePINVOKE.enum_test((int)c, (int)s);
 }
Exemplo n.º 6
0
        void drawFill(type t, color c, Graphics g)
        {
            int x = 6;
            int y = 8;
            int w = this.Width - 12;
            int h = (this.Height / 2) - 8;

            if (t == type.FULL)
            {
                x = 2; y = 2; h = this.Height - 4; w = this.Width - 4;
            }

            if (t == type.LOWER)
            {
                y = this.Height / 2;
            }

            switch (c)
            {
            case color.OFF:
                g.FillRectangle(Off, x, y, w, h);
                break;

            case color.AMBER:
                g.FillRectangle(AmberDim, x, y, w, h);
                break;

            case color.AMBER_LIT:
                g.FillRectangle(AmberLit, x, y, w, h);
                break;

            case color.RED:
                g.FillRectangle(RedDim, x, y, w, h);
                break;

            case color.RED_LIT:
                g.FillRectangle(RedLit, x, y, w, h);
                break;

            case color.GREEN:
                g.FillRectangle(GreenDim, x, y, w, h);
                break;

            case color.GREEN_LIT:
                g.FillRectangle(GreenLit, x, y, w, h);
                break;

            case color.BLUE:
                g.FillRectangle(BlueDim, x, y, w, h);
                break;

            case color.BLUE_LIT:
                g.FillRectangle(BlueLit, x, y, w, h);
                break;

            case color.WHITE_LIT:
                g.FillRectangle(BlankLit, x, y, w, h);
                break;

            case color.WHITE:
            default:
                g.FillRectangle(BlankDim, x, y, w, h);
                break;
            }
        }
 /// casts to a UnityEngine.Color
 public static Color cast(this color f) => (Color)f;
Exemplo n.º 8
0
 public bool Update(color color) => colorRepository.Update(color);
Exemplo n.º 9
0
 return(new CircleAnnotationRenderable(centerPosition + vec, radius, width, color, filled));
Exemplo n.º 10
0
 public static double cmin(this color f) => math.cmin(f);
Exemplo n.º 11
0
 public static float cmax(this color f) => math.cmax(f);
Exemplo n.º 12
0
        public void Initialize(Texture2D texture,Vector2 pos,World world)
        {
            auraContacts = new Dictionary<string, HashSet<Rectangle>>()
            {
                {"o", new HashSet<Rectangle>()},
                {"b", new HashSet<Rectangle>()},
                {"g", new HashSet<Rectangle>()},
                {"y", new HashSet<Rectangle>()},
            };

            UnicornTexture = texture;
            Position = pos;
            CurrentColor = color.n;
            if(_body != null)
                _body.Dispose();
            _body = BodyFactory.CreateRectangle(world,
                                                ConvertUnits.ToSimUnits(96),
                                                ConvertUnits.ToSimUnits(96), 0f);

            _body.BodyType = BodyType.Dynamic;
            _body.Restitution = 0f;
            _body.Friction = 0f;
            _body.Position = ConvertUnits.ToSimUnits(pos.X,pos.Y);
            _body.BodyName = "Unicorn";
            _body.UserData = new Vector2(96, 96);
             hitting = false;
            _body.OnCollision += MyOnCollision;
            _body.OnSeparation += MyOnSeparation;

            HairTexture = new Texture2D[hairAmout];
            for (int i = 0; i < hairAmout; i++)
            {
                string tempPath = "Uno_body_" + colorPath[i].ToString();
                HairTexture[i] = Content.Load<Texture2D>(tempPath);
            }
            EyePopTexture = Content.Load<Texture2D>("Uno_eye");

            ChangeHair("");

            footstepAudio = Content.Load<SoundEffect>("sfx/footstep");

            footstepCopy = footstepAudio.CreateInstance();
        }
Exemplo n.º 13
0
        public void ChangeHair(string balloonColor)
        {
            string temp = "Uno_";
            colorStatu = null;
            switch (balloonColor)
            {

                case "Balloon_blue":
                    colorStatu = temp + "blue";
                    colorIndex = 0;
                    CurrentColor = color.b;
                    break;
                case "Balloon_green":
                    colorStatu = temp + "green";
                    colorIndex = 1;
                    CurrentColor = color.g;
                    break;
                case "Balloon_orange":
                    colorStatu = temp + "orange";
                    colorIndex = 2;
                    CurrentColor = color.o;
                    break;
                case "Balloon_red":
                    colorStatu = temp + "red";
                    CurrentColor = color.r;
                    break;
                case "Balloon_yellow":
                    colorStatu = temp + "yellow";
                    colorIndex = 3;
                    CurrentColor = color.y;
                    break;
                default:
                    colorStatu = "normal";
                    CurrentColor = color.n;
                    break;
            }

            if (touchingcolor != CurrentColor.ToString())
            {
                contactFloorName = "f";
            }
        }
Exemplo n.º 14
0
 public static color returnOpposite(color current)
 {
     return((color)((int)current ^ 1));
 }
Exemplo n.º 15
0
 public void ChangeColor()
 {
     currentColor = (color)(((int)currentColor) ^ 1);
 }
Exemplo n.º 16
0
 public Color()
 {
     currentColor = (color)(new Random().Next(2));
 }
Exemplo n.º 17
0
 public bool Delete(color color) => colorRepository.Delete(color);
Exemplo n.º 18
0
        static color RGBToHSV(color rgb)
        {
            double max;
            double min;
            double R, G, B, H, S, V;

            R = (double)rgb.R / 255.0;
            G = (double)rgb.G / 255.0;
            B = (double)rgb.B / 255.0;

            if (R >= G && R >= B)
            {
                max = R;
                min = (G < B) ? G : B;
            }
            else if (G >= R && G >= B)
            {
                max = G;
                min = (R < B) ? R : B;
            }
            else
            {
                max = B;
                min = (R < G) ? R : G;
            }
            if (R == G && G == B)
            {
                H = 0.0f;
            }
            else if (max == R)
            {
                H = 60 * (G - B) / (max - min);
            }
            else if (max == G)
            {
                H = 60 * (B - R) / (max - min) + 120;
            }
            else
            {
                H = 60 * (R - G) / (max - min) + 240;
            }
            if (H < 0.0f)
            {
                H += 360.0f;
            }
            if (max == 0.0f)
            {
                S = 0.0f;
            }
            else
            {
                S = (max - min) / max;
            }
            V = max;

            color ret = new color();

            ret.R = (int)Math.Round(H / 360 * 252, MidpointRounding.AwayFromZero);
            ret.G = (int)Math.Round(S * 255, MidpointRounding.AwayFromZero);
            ret.B = (int)Math.Round(V * 255, MidpointRounding.AwayFromZero);
            return(ret);
        }
 public static float3 asfloat3(this color c) => (float3)c;
Exemplo n.º 20
0
 public int comparar (color c1, color c2)
 {
     color=["azul", "amarillo", "rojo", "negro", "blanco", "Rosado", "Gris", "Verde"]
 public static float4 asfloat(this color c) => c; // Compatibility
Exemplo n.º 22
0
 return(new RangeCircleAnnotationRenderable(centerPosition + vec, radius, zOffset, color, width, borderColor, borderWidth));
Exemplo n.º 23
0
		/// <summary>
		/// Creates a string from the Island information of a Island
		/// </summary>
		/// <param name="c"> The color of the Island </param>
		/// <param name="number"> It's numerical value </param>
		/// <returns> The info in string form </returns>
		public static string CreateStringWithIslandInfo(color c, int number) {
			return c.ToString("g") + " " + number.ToString();
		}
Exemplo n.º 24
0
 public Tomato(string name, form shape, double cost, string where, color color, string date) : base(name, shape, cost, where)
 {
     this.color = color;
     this.date  = date;
     root_crop  = true;
 }
Exemplo n.º 25
0
 public Berry(string name, form shape, double cost, string where, color color, string date) : base(name, shape, cost, where)
 {
     this.color = color;
     this.date  = date;
     root_crop  = false;
 }
Exemplo n.º 26
0
        bool CheckBuildingAvailability(vec2 GridCoord, int PlayerNum, int TeamNum, float BuildingToPlace, bool[] CanPlace)
        {
            int _w = 3, _h = 3;

            Render.UnsetDevice();

            bool CanPlaceItem = false;

            for (int i = 0; i < _w; i++)
            {
                for (int j = 0; j < _h; j++)
                {
                    CanPlace[i + j * _w] = false;
                }
            }

            if (BuildingToPlace == UnitType.Barracks && PlayerNum > 0)
            {
                var _data = DataGroup.CurrentData.GetData <building>(GridCoord, new vec2(_w, _h));
                var _dist = DataGroup.DistanceToPlayers.GetData <PlayerTuple>(GridCoord, new vec2(_w, _h));

                color clr = color.TransparentBlack;
                if (_data != null)
                {
                    CanPlaceItem = true;
                    for (int i = 0; i < _w; i++)
                    {
                        for (int j = 0; j < _h; j++)
                        {
                            var building_here = _data[i + j * _w];
                            var distance_to   = _dist[i + j * _w];

                            var distance = GetPlayerVal(distance_to, PlayerNum);

                            bool occupied     = building_here.direction > 0;
                            bool in_territory = distance < DrawTerritoryPlayer.TerritoryCutoff;

                            bool can_place = !occupied && (in_territory || MapEditorActive);
                            CanPlace[i + j * _w] = can_place;

                            if (!can_place)
                            {
                                CanPlaceItem = false;
                            }
                        }
                    }
                }
            }

            if (BuildingToPlace == UnitType.GoldMine || BuildingToPlace == UnitType.JadeMine)
            {
                var _data = DataGroup.CurrentUnits.GetData <unit>(GridCoord, new vec2(_w, _h));
                var _dist = DataGroup.DistanceToPlayers.GetData <PlayerTuple>(GridCoord, new vec2(_w, _h));

                color clr = color.TransparentBlack;
                if (_data != null)
                {
                    CanPlaceItem = true;
                    for (int i = 0; i < _w; i++)
                    {
                        for (int j = 0; j < _h; j++)
                        {
                            var unit_here   = _data[i + j * _w];
                            var distance_to = _dist[i + j * _w];

                            var distance = GetPlayerVal(distance_to, PlayerNum);

                            bool occupied        = unit_here.type > 0;
                            bool is_valid_source = unit_here.team == Team.None && unit_here.type == BuildingToPlace;
                            bool in_territory    = distance < DrawTerritoryPlayer.TerritoryCutoff;

                            bool can_place = (is_valid_source || MapEditorActive && !occupied) && (in_territory || MapEditorActive);
                            CanPlace[i + j * _w] = can_place;

                            if (!can_place)
                            {
                                CanPlaceItem = false;
                            }
                        }
                    }
                }
            }

            return(CanPlaceItem);
        }
Exemplo n.º 27
0
 Colorref GetColorref(color c)
 {
     return Colorref.FromRGB(c.red, c.green, c.blue);
 }
Exemplo n.º 28
0
 protected void fill(color color)
 {
     warning("fill(color)");
 }
Exemplo n.º 29
0
 public override void Pixel(float x, float y, color c)
 {
     Graphics.DeviceContext.SetPixel((int)x, (int)y, GetColorref(c)); 
 }
Exemplo n.º 30
0
 public bool Add(color color) => colorRepository.Add(color);
Exemplo n.º 31
0
        public void SetColor(color clr)
        {
            Color _clr = new Color(FragSharpMarshal.Marshal(clr));

            vertexData[TOP_LEFT].Color = _clr;
            vertexData[TOP_RIGHT].Color = _clr;
            vertexData[BOTTOM_RIGHT].Color = _clr;
            vertexData[BOTTOM_LEFT].Color = _clr;
        }
Exemplo n.º 32
0
 public Player(color color)
 {
     PlayersColor = color;
 }