Beispiel #1
0
 public Car(
     string i_ModelName,
     string i_LicensePlate,
     float i_EnergyLeft,
     string i_ManufacturerName,
     eColor i_Color,
     eDoorsAmount i_DoorsNumber,
     float i_MaxEngineCapacity,
     float i_CurrentAirPressure,
     Engine i_Engine,
     Vehicle.eType i_VehicleType) : base(
         i_ModelName,
         i_LicensePlate,
         i_EnergyLeft,
         k_NumberOfWheels,
         k_WheelsMaxAirPressure,
         i_ManufacturerName,
         i_MaxEngineCapacity,
         i_CurrentAirPressure,
         i_Engine,
         i_VehicleType)
 {
     m_Color       = i_Color;
     m_DoorsNumber = i_DoorsNumber;
 }
        public static Color Parse(string i_ColorAsStr)
        {
            eColor colorToSet = eColor.Black;

            if (i_ColorAsStr == "1" || i_ColorAsStr == "Blue" || i_ColorAsStr == "blue" || i_ColorAsStr == "BLUE")
            {
                colorToSet = eColor.Blue;
            }
            else if (i_ColorAsStr == "2" || i_ColorAsStr == "White" || i_ColorAsStr == "white" || i_ColorAsStr == "WHITE")
            {
                colorToSet = eColor.White;
            }
            else if (i_ColorAsStr == "3" || i_ColorAsStr == "Yellow" || i_ColorAsStr == "yellow" || i_ColorAsStr == "YELLOW")
            {
                colorToSet = eColor.Yellow;
            }
            else if (i_ColorAsStr != "4" && i_ColorAsStr != "Black" && i_ColorAsStr != "black" && i_ColorAsStr != "BLACK")
            {
                throw new FormatException();
            }

            Color color = new Color();

            color.m_Color = colorToSet;

            return(color);
        }
Beispiel #3
0
        // Get car color from the user.
        private eColor GetColor()
        {
            eColor inputColor = eColor.Other;

            Console.WriteLine("Choose the number of the car color :\n"
                              + "(1)Yello  " + "(2)White  " + "(3)Red  " + "(4)Black  " + "(5)Other  ");
            string inputColorStr = Console.ReadLine();

            switch (inputColorStr)
            {
            case "1":
                inputColor = eColor.Yellow;
                break;

            case "2":
                inputColor = eColor.White;
                break;

            case "3":
                inputColor = eColor.Red;
                break;

            case "4":
                inputColor = eColor.Black;
                break;

            case "5":
                inputColor = eColor.Other;
                break;
            }

            return(inputColor);
        }
        public GuessColorButton(Color i_Color) : base(i_Color)
        {
            eColor color = (eColor)Enum.Parse(typeof(eColor), i_Color.Name);

            this.BackColor = i_Color;
            this.m_ValueOfTheGuessInCharFormat = (char)color;
        }
Beispiel #5
0
 public Car
     (eEnergyType i_EnergyType, string i_LicensePlate, short i_NumberOfWheels, float i_MaxAirPressure, float i_MaxEnergy, Fuel.eFuelType i_FuelType = Fuel.eFuelType.Octan96)
     : base(i_EnergyType, i_LicensePlate, i_NumberOfWheels, i_MaxAirPressure, i_MaxEnergy, Fuel.eFuelType.Octan96)
 {
     m_Color         = eColor.Red;
     m_NumberOfDoors = 2;
 }
Beispiel #6
0
 public Car(
     Owner i_Owner, string i_Model, string i_LicenceNumber, Tank i_Tank, Wheel[] i_Wheels, eColor i_Color, eNumberOfDoors i_NumberOfDoors)
     : base(i_Owner, i_Model, i_LicenceNumber, i_Tank, i_Wheels)
 {
     m_Color         = i_Color;
     m_NumberOfDoors = i_NumberOfDoors;
 }
        private eColor getColorFromString(string i_ValStr)
        {
            eColor color = new eColor();

            Enum.TryParse(i_ValStr, out color);

            switch (color)
            {
            case (eColor.Black):
                break;

            case (eColor.Blue):
                break;

            case (eColor.Silver):
                break;

            case (eColor.White):
                break;

            default:
                throw new ArgumentException("No such color option!");
            }

            return(color);
        }
 public static short GetColor(eColor Color)
 {
     // 紅
     if (Color == eColor.Color_Red)
     {
         return((short)HSSFColor.RED.index);
     }
     // 綠
     if (Color == eColor.Color_Green)
     {
         return((short)HSSFColor.GREEN.index);
     }
     // 黑
     if (Color == eColor.Color_Black)
     {
         return((short)HSSFColor.BLACK.index);
     }
     // 白
     if (Color == eColor.Color_White)
     {
         return((short)HSSFColor.WHITE.index);
     }
     // 藍
     if (Color == eColor.Color_Blue)
     {
         return((short)HSSFColor.BLUE.index);
     }
     // 黃
     if (Color == eColor.Color_Yellow)
     {
         return((short)HSSFColor.YELLOW.index);
     }
     return(0);
 }
Beispiel #9
0
 public ElectricCar(int i_AmountOfDoors, float i_BatteryTimeremainingInhours, eColor i_ColorOfCar
                    , string i_ModelName, string i_LicenseNumber,
                    float i_PercentageOfEnergyRemainingInItsEnergysource, float i_CurrentAirPressur, String i_WheelManufacturerName) :
     base(i_AmountOfDoors, i_ColorOfCar, i_ModelName, i_LicenseNumber,
          i_PercentageOfEnergyRemainingInItsEnergysource, i_WheelManufacturerName, i_CurrentAirPressur, new ElectricalEnergy(MaximumBatteryInHours * 60, i_BatteryTimeremainingInhours * 60))
 {
 }
Beispiel #10
0
    private void SetSpriteColor(eColor color)
    {
        switch (color)
        {
        case eColor.WHITE:
            spriteRenderer.color = new Color(1.0f, 1.0f, 1.0f, 1.0f);
            break;

        case eColor.BLACK:
            spriteRenderer.color = new Color(0.0f, 0.0f, 0.0f, 1.0f);
            break;

        case eColor.W_HOVER:
            spriteRenderer.color = new Color(1.0f, 1.0f, 1.0f, 0.5f);
            break;

        case eColor.B_HOVER:
            spriteRenderer.color = new Color(0.0f, 0.0f, 0.0f, 0.5f);
            break;

        case eColor.EMPTY:
            spriteRenderer.color = new Color(1.0f, 1.0f, 1.0f, 0.0f);
            break;
        }
    }
Beispiel #11
0
 public Car(string i_ModelName, string i_LicenseNumber, string i_OwnerName,
            string i_OwnerPhoneNumber, List <Wheel> i_wheels, eColor i_CarColor, eNumOfDoors i_NumOfDoors, EnergySystem i_energySystem)
     : base(i_ModelName, i_LicenseNumber, i_OwnerName, i_OwnerPhoneNumber, i_wheels, i_energySystem)
 {
     m_CarColor   = i_CarColor;
     m_NumOfDoors = i_NumOfDoors;
 }
Beispiel #12
0
        internal override void SetSpecialVehicleParameter(string i_ParameterName, string i_ParameterValue)
        {
            if (i_ParameterName.Equals(m_SpecialParameterNames[0]))
            {
                eColor givenColor = (eColor)Enum.Parse(typeof(eColor), i_ParameterValue);
                if (Enum.IsDefined(typeof(eColor), givenColor))
                {
                    m_CarColor = givenColor;
                }
                else
                {
                    throw new ArgumentException("Invalid input for Car Color!");
                }
            }

            if (i_ParameterName.Equals(m_SpecialParameterNames[1]))
            {
                eDoorNumbers givenDoorNumber = (eDoorNumbers)Enum.Parse(typeof(eDoorNumbers), i_ParameterValue);
                if (Enum.IsDefined(typeof(eDoorNumbers), givenDoorNumber))
                {
                    m_DoorNumber = givenDoorNumber;
                }
                else
                {
                    throw new ArgumentException("Illegal input for Door Number!");
                }
            }
        }
Beispiel #13
0
        //---
        public Basis draw(int selected, eColor def)
        {
            Basis c = new Basis();

            eColor cl = def;

            for (int i = 0; i < data.Count; i++)
            {
                if (i == selected && data[i].GetType() != typeof(color))
                {
                    continue;
                }

                cl = data[i].draw(ref c, cl, i);
            }
            if (selected >= 0)
            {
                data[selected].draw(ref c, eColor.Selected, selected);
            }
            bool changeCanvas = false;

            c      = compare(ref changeCanvas, c);
            canvas = c;
            return(c);
        }
Beispiel #14
0
        //---
        public Color RGB32(eColor cl)
        {
            if (cl == eColor.Def)
            {
                cl = color.Default;
            }
            if (cl < eColor.Def)
            {
                UInt16 col = color.indColorTab[(int)cl];

                int r = (col >> 11) << 3;
                int g = ((col >> 5) & 63) << 2;
                int b = (col & 31) << 3;
                return(Color.FromArgb(r, g, b));
            }
            if (cl == eColor.Selected)
            {
                return(selected);
            }
            if (cl == eColor.SelectedPoint)
            {
                return(selectedPoint);
            }
            if (cl == eColor.HotPoint)
            {
                return(hotPoint);
            }

            return(backGround);
        }
    public void SetColor(eColor newColor, ColoredPlatform platform)
    {
        if (!m_Unlocked)
            newColor = eColor.Black;

        int ind = 0;
        for (ind = 0; ind < PlatformColor.eColorList.Length && PlatformColor.eColorList[ind] != newColor; ++ind);
        int mind = 0;
        for (mind = 0; mind < PlatformColor.eColorList.Length && PlatformColor.eColorList[mind] != m_Color; ++mind);

        int mask = LayerMask.NameToLayer(PlatformColor.NameList[ind]);

        platform.SetColor (PlatformColor.ColorList[ind]);
        platform.transform.name = PlatformColor.NameList[ind];

        Queue<Transform> children = new Queue<Transform>();
        children.Enqueue(platform.transform);

        while (children.Count > 0)
        {
            Transform t = children.Dequeue ();
            t.gameObject.layer = mask;
            foreach (Transform child in t)
                children.Enqueue (child);
        }
    }
Beispiel #16
0
        private void InitControls()
        {
            eColor defaultColor = eColor.Control;

            foreach (eColor color in Enum.GetValues(typeof(eColor)))
            {
                if (!color.Equals(defaultColor))
                {
                    createGuessColoredButton(color);
                }
            }

            int xPosition = (this.ClientSize.Width - (k_NumberOfButtonInARow * ColorButton.k_Width)) / 2;
            int yPosition = (this.ClientSize.Height - (k_NumberOfButtonInAColumn * ColorButton.k_Height)) / 2;
            int numOfButtonInCurrentRow = 0;

            foreach (ColorButton button in m_ColorButtons.Values)
            {
                this.Controls.Add(button);
                button.Location = new Point(xPosition, yPosition);
                button.Click   += new EventHandler(OnClickColoredButton);
                xPosition      += button.Width + 2;
                numOfButtonInCurrentRow++;

                if (numOfButtonInCurrentRow >= k_NumberOfButtonInARow)
                {
                    xPosition  = (this.ClientSize.Width - (k_NumberOfButtonInARow * 40)) / 2;
                    yPosition += button.Height + 2;
                    numOfButtonInCurrentRow = 0;
                }
            }
        }
Beispiel #17
0
    public List <Node> FindCaptures(Node last)
    {
        List <Node>   captures = new List <Node>();
        eColor        other    = (last.color == eColor.BLACK) ? eColor.WHITE : eColor.BLACK;
        List <eColor> capture  = new List <eColor>()
        {
            last.color, other, other, last.color
        };
        List <Line> captureLines = GetLines(last, 4);

        foreach (Line line in captureLines)
        {
            for (int i = 0; i < line.nodes.Count - 4; i++)
            {
                List <Node>   nodeLine = line.nodes.GetRange(i, 4);
                List <eColor> colors   = new List <eColor>();
                foreach (Node node in nodeLine)
                {
                    colors.Add(node.color);
                }
                if (capture.SequenceEqual(colors))
                {
                    captures.Add(nodeLine[1]);
                    captures.Add(nodeLine[2]);
                }
            }
        }
        return(captures);
    }
Beispiel #18
0
        public void LoadUcGame(string folderPath)
        {
            eColor  tmpec = new eColor();
            eStatus tmpes = new eStatus();

            List <ccCard> curCards = new List <ccCard> {
            };
            //InitializNamesAttrib();
            // מתוך הנחה שמדובר במקסימום 2 שחקנים אז התור הקודם הוא או 1 או 0
            int beforeTurn = turn == 0 ? 1 : 0;

            //XDocument doc = XDocument.Load(path + "\\" + folderPath + "\\lastGame.xml");// לא בטוח טוב
            XDocument doc  = XDocument.Load(folderPath + ".xml");
            var       prop = doc.Element("properties");

            // שליפת התור הנוכחי
            turn = (int)prop.Attribute("turn");

            // שליפת אבני הקופה
            box.Clear();  //ריקון אבני הקופה כדי לאתחלה לפי המשחק השמור
            foreach (XElement crd in prop.Element("box").Elements())
            {
                int    curNum   = (int)crd.Attribute("number");
                string curColor = (string)crd.Attribute("color");
                string stt      = (string)crd.Attribute("status");
                tmpec = ToEColor(curColor);
                tmpes = ToEStatus(stt);
                box.Add(new ccCard((byte)curNum, tmpec, tmpes));
            }

            // שליפת לוח המשחק
            if (mainBoard.Count > 0)
            {
                mainBoard.Clear(); //ריקון לוח המשחק כדי לאתחלה לפי המשחק השמור
            }
            else
            {
                mainBoard = new List <List <ccCard> > {
                }
            };
            foreach (XElement seria in prop.Element("mainBoard").Elements())
            {
                List <ccCard> tmp = new List <ccCard> {
                };
                int i             = 0;

                foreach (XElement crd in seria.Elements())
                {
                    int    curNum   = (int)crd.Attribute("number");
                    string curColor = (string)crd.Attribute("color");
                    string stt      = (string)crd.Attribute("status");
                    tmpec = ToEColor(curColor);
                    tmpes = ToEStatus(stt);
                    tmp.Add(new ccCard((byte)curNum, tmpec, tmpes));
                }
                mainBoard.Add(tmp);
                i++;
            }
            //Show_Cards();
        }
Beispiel #19
0
    public static void ChangeMusic(eColor c)
    {
        Instance.currentColor = PlatformColor.ToString (c);

        switch (Instance.currentColor) {
        case "Red":
            Instance.nextclip = Instance.redmusic;
            //Instance.SFX.PlayOneShot(Instance.redmusictran,.8f);
            break;
        case "Blue":
            Instance.nextclip = Instance.bluemusic;
            //Instance.SFX.PlayOneShot(Instance.bluemusictran,.8f);
            break;
        case "Yellow":
            Instance.nextclip = Instance.yellowmusic;
            //Instance.SFX.PlayOneShot(Instance.yellowmusictran,.8f);
            break;
        case "White":
            Instance.nextclip = Instance.whitemusic;
            break;
        }

        Instance.currentTime = Instance.source.timeSamples;

        Instance.source.clip = Instance.nextclip;
        Instance.source.PlayDelayed(0);
        Instance.source.timeSamples = Instance.currentTime;
    }
Beispiel #20
0
        // private string m_wheelManufacturer;

        public Car(eColor i_color, eCarNumberOfDoors i_numberOfDoors, VehicleInformation i_vehicleInformation, string i_wheelManufacturer) : base(i_vehicleInformation)
        {
            m_wheelInformation    = new WheelInformation(32, 4, i_wheelManufacturer);
            base.WheelInformation = m_wheelInformation;
            m_numberOfDoors       = i_numberOfDoors;
            m_color = i_color;
        }
    public void SetNewActiveColor(eColor activeColour, eColor secondColour, eColor thirdColour)
    {
        if (activeColour == eColor.White) {
            foregroundCamera.cullingMask = baseCullMask;
            foregroundCamera_BG.enabled = false;
        }
        else {
            foregroundCamera.cullingMask = baseCullMask + (1 << LayerMask.NameToLayer (PlatformColor.ToString(activeColour)));
            foregroundCamera_BG.enabled = true;
            foregroundCamera_BG.cullingMask = (1 << LayerMask.NameToLayer (PlatformColor.ToString(activeColour) + " BG"));
        }

        if (secondColour == eColor.White) {
            secondCamera.enabled = false;
            secondCamera_BG.enabled = false;
        }
        else {
            secondCamera.enabled = true;
            secondCamera.cullingMask = baseCullMask + (1 << LayerMask.NameToLayer (PlatformColor.ToString(secondColour)));
            secondCamera_BG.enabled = true;
            secondCamera_BG.cullingMask = baseCullMask + (1 << LayerMask.NameToLayer (PlatformColor.ToString(secondColour) + " BG"));
        }

        if (thirdColour == eColor.White) {
            thirdCamera.enabled = false;
            thirdCamera_BG.enabled = false;
        }
        else {
            thirdCamera.enabled = true;
            thirdCamera.cullingMask = baseCullMask + (1 << LayerMask.NameToLayer (PlatformColor.ToString(thirdColour)));
            thirdCamera_BG.enabled = false;
            thirdCamera_BG.cullingMask = baseCullMask + (1 << LayerMask.NameToLayer (PlatformColor.ToString(thirdColour) + " BG"));
        }
    }
Beispiel #22
0
        public override void SetAdditionalFields(Dictionary <string, string> i_AdditionalFieldsToSet)
        {
            if (int.TryParse(i_AdditionalFieldsToSet["CarColor"], out int carColorChoice))
            {
                if (Enum.IsDefined(typeof(eColor), carColorChoice))
                {
                    m_CarColor = (eColor)carColorChoice;
                }
                else
                {
                    throw new ArgumentException(k_NoSuchAOption + "color");
                }
            }
            else
            {
                throw new FormatException("Car Color Error:" + k_InvalidValue);
            }

            if (int.TryParse(i_AdditionalFieldsToSet["NumOfDoors"], out int numOfDoorsChoice))
            {
                if (Enum.IsDefined(typeof(eNumDoors), numOfDoorsChoice))
                {
                    m_NumOfDoors = (eNumDoors)numOfDoorsChoice;
                }
                else
                {
                    throw new ArgumentException(k_NoSuchAOption + "Num Of Doors");
                }
            }
            else
            {
                throw new FormatException("Num Of Doors Error:" + k_InvalidValue);
            }
        }
 public void CarVehicle(eColor i_Color, eNumberOfDoors i_NumberOfDoors)
 {
     m_Color          = i_Color;
     m_NumberOfDoors  = i_NumberOfDoors;
     m_CheckedList[3] = true;
     m_CheckedList[4] = true;
 }
Beispiel #24
0
    private void OnMouseEnter()
    {
        eColor curPlayerColor = eColor.EMPTY;

        switch (turnManager.playerTurn)
        {
        case PlayerTurn.BLACK_PLAYER1:
            curPlayerColor = eColor.BLACK;
            break;

        case PlayerTurn.WHITE_PLAYER2:
            if (TurnManager.Instance.p2.playerType != PlayerType.COMPUTER)
            {
                curPlayerColor = eColor.WHITE;
            }
            break;
        }
        if (Color == eColor.EMPTY && boardManager.IsValidPlacement(turnManager.playerTurn, turnManager.TurnCount, this.node, curPlayerColor))
        {
            switch (turnManager.playerTurn)
            {
            case PlayerTurn.BLACK_PLAYER1:
                curPlayerColor = eColor.B_HOVER;
                break;

            case PlayerTurn.WHITE_PLAYER2:
                if (TurnManager.Instance.p2.playerType != PlayerType.COMPUTER)
                {
                    curPlayerColor = eColor.W_HOVER;
                }
                break;
            }
            Color = curPlayerColor;
        }
    }
Beispiel #25
0
    public void SetLineColor(eColor col)
    {
        switch (col)
        {
        case eColor.RED:
            line.material.EnableKeyword("RED_ON");
            line.material.DisableKeyword("BLUE_ON");
            line.material.DisableKeyword("BLACK_ON");
            line.material.DisableKeyword("PURPLE_ON");
            line.material.DisableKeyword("GREEN_ON");
            line.material.DisableKeyword("YELLOW_ON");
            break;

        case eColor.BLUE:
            line.material.DisableKeyword("RED_ON");
            line.material.EnableKeyword("BLUE_ON");
            line.material.DisableKeyword("BLACK_ON");
            line.material.DisableKeyword("PURPLE_ON");
            line.material.DisableKeyword("GREEN_ON");
            line.material.DisableKeyword("YELLOW_ON");
            break;

        case eColor.BLACK:
            line.material.DisableKeyword("RED_ON");
            line.material.DisableKeyword("BLUE_ON");
            line.material.EnableKeyword("BLACK_ON");
            line.material.DisableKeyword("PURPLE_ON");
            line.material.DisableKeyword("GREEN_ON");
            line.material.DisableKeyword("YELLOW_ON");
            break;

        case eColor.PURPLE:
            line.material.DisableKeyword("RED_ON");
            line.material.DisableKeyword("BLUE_ON");
            line.material.DisableKeyword("BLACK_ON");
            line.material.EnableKeyword("PURPLE_ON");
            line.material.DisableKeyword("GREEN_ON");
            line.material.DisableKeyword("YELLOW_ON");
            break;

        case eColor.GREEN:
            line.material.DisableKeyword("RED_ON");
            line.material.DisableKeyword("BLUE_ON");
            line.material.DisableKeyword("BLACK_ON");
            line.material.DisableKeyword("PURPLE_ON");
            line.material.EnableKeyword("GREEN_ON");
            line.material.DisableKeyword("YELLOW_ON");
            break;

        case eColor.YELLOW:
            line.material.DisableKeyword("RED_ON");
            line.material.DisableKeyword("BLUE_ON");
            line.material.DisableKeyword("BLACK_ON");
            line.material.DisableKeyword("PURPLE_ON");
            line.material.DisableKeyword("GREEN_ON");
            line.material.EnableKeyword("YELLOW_ON");
            break;
        }
    }
Beispiel #26
0
 public void UpdateNode()
 {
     if (node.color != color)
     {
         SetSpriteColor(node.color);
         color = node.color;
     }
 }
Beispiel #27
0
 public Car(string i_Name, string i_Id, float i_EnergyLevel,
            List <Tier> i_Tiers, Engine i_Engine, eColor i_Color,
            eDoors i_Doors)
     : base(i_Name, i_Id, i_Tiers, i_Engine)
 {
     m_Color = i_Color;
     m_Doors = i_Doors;
 }
Beispiel #28
0
    public static string ToString(eColor c)
    {
        for (int i = 0; i < eColorList.Length; ++i)
            if (eColorList[i] == c)
                return NameList[i];

        return "White";
    }
        public ElectricCar(string i_LicenseNumber) : base(i_LicenseNumber)
        {
            const eColor       k_DefaultColor      = eColor.Black;
            const eDoorsNumber k_DefaultDoorNumber = eDoorsNumber.Four;

            this.Color       = k_DefaultColor;
            this.DoorsNumber = k_DefaultDoorNumber;
        }
Beispiel #30
0
    public static UnityEngine.Color ToColor(eColor c)
    {
        for (int i = 0; i < eColorList.Length; ++i)
            if (eColorList[i] == c)
                return ColorList[i];

        return Color.gray;
    }
        public override void InitializeVehicleWithAdditionalProps(string i_PathOfFileWithValuesToClassMembers)
        {
            string[] valsForMembers = File.ReadAllLines(i_PathOfFileWithValuesToClassMembers);

            //[0] is color:
            m_Color = getColorFromString(valsForMembers[0]);
            //[1] is num of doors:
            m_NumOfDoors = getDoorsNumFromString(valsForMembers[1]);
        }
Beispiel #32
0
 public Car(int i_AmountOfDoors, eColor i_ColorOfCar
            , string i_ModelName, string i_LicenseNumber,
            float i_PercentageOfEnergyRemainingInItsEnergysource, String i_WheelManufacturerName, float i_CurrentAirPressur, VehicleEnergy i_VehicleEnergy)
     : base(i_ModelName, i_LicenseNumber, i_PercentageOfEnergyRemainingInItsEnergysource,
            k_NumberOfWheelsInCar, k_CarWheelsMaxAirPressure, i_WheelManufacturerName, i_CurrentAirPressur, i_VehicleEnergy)
 {
     r_ColorOfCar    = i_ColorOfCar;
     r_AmountOfDoors = i_AmountOfDoors;
 }
Beispiel #33
0
    public void ColorShift(eColor newColor)
    {
        //TODO: When sprites are added, change this region to use sprites
        #region change player color

        renderer.material.color = PlatformColor.ToColor(newColor);

        #endregion
    }
Beispiel #34
0
        public ccCard(byte num, eColor col)
        {
            InitializeComponent();
            number = num;

            color = col;

            switch (color)
            {
            case eColor.Blue:
                this.ForeColor = Color.Blue;
                break;

            case eColor.Red:
                this.ForeColor = Color.Red;
                break;

            case eColor.Green:
                this.ForeColor = Color.Green;
                break;

            case eColor.Orange:
                this.ForeColor = Color.Orange;
                break;
            }

            this.Text   = number.ToString();
            this.Height = height_card;
            this.Width  = width_card;

            if (this.number == 14)
            {
                this.Text = "";
                switch (color)
                {
                case eColor.Blue:
                    this.BackgroundImage = global::RammyCube.Properties.Resources.JBlue;
                    break;

                case eColor.Red:
                    this.BackgroundImage = global::RammyCube.Properties.Resources.JRed;
                    break;

                case eColor.Green:
                    this.BackgroundImage = global::RammyCube.Properties.Resources.JGreen;
                    break;

                case eColor.Orange:
                    this.BackgroundImage = global::RammyCube.Properties.Resources.JYellow;
                    break;
                }
            }


            this.Show();
        }
Beispiel #35
0
 public Car(string i_Model, string i_LicenseNumber, string i_WheelManufacturerName, float i_WheelMaxAirPressure, eColor i_Color, eNumOfDoors i_NumberOfDoors, EnergySource i_DrivingForce)
     : base(i_Model, i_LicenseNumber)
 {
     this.r_Color                      = i_Color;
     this.r_NumberOfDoors              = i_NumberOfDoors;
     this.m_EnergySource               = i_DrivingForce;
     this.m_NumberOfWheels             = sr_CarNumberOfWheels;
     this.m_VehicleWheelMaxAirPressure = sr_CarWheelMaxAirPressure;
     this.AddWheels(i_WheelManufacturerName, i_WheelMaxAirPressure);
 }
Beispiel #36
0
 private void OnMouseExit()
 {
     if (Color == eColor.W_HOVER || Color == eColor.B_HOVER)
     {
         if (turnManager.playerTurn != PlayerTurn.WHITE_PLAYER2 || turnManager.p2.playerType != PlayerType.COMPUTER)
         {
             Color = eColor.EMPTY;
         }
     }
 }
Beispiel #37
0
 public void resetProperties() {
     id		= -1;
     name 	= string.Empty;
     code 	= 'A';
     weight	= 0.0f;
     isMale	= true;
     skinColor = eColor.YELLOW;
     car.reset();
     boss	= null;
 }
 public void SetActiveColor(eColor newColor)
 {
     if (m_Color == newColor)
     {
         if (m_Color == eColor.White && Application.isPlaying)
         {
             SetColor(eColor.Red,    m_WhitePlatforms[0]);
             SetColor(eColor.Blue,   m_WhitePlatforms[1]);
             SetColor(eColor.Yellow, m_WhitePlatforms[2]);
         }
         else
             SetColor(newColor, m_Platform);
     }
     m_Collider.enabled = m_Unlocked && (m_Color == eColor.White || m_Color == newColor);
 }
Beispiel #39
0
 public void SetActiveColor(eColor newColor, bool anyColorUnlocked = false)
 {
     if (m_Color == eColor.White && Application.isPlaying)
     {
         if (anyColorUnlocked)
             SetColor(eColor.Red,    m_WhitePlatforms[0]);
         else
             SetColor(eColor.White,  m_WhitePlatforms[0]);
         SetColor(eColor.Blue,   m_WhitePlatforms[1]);
         SetColor(eColor.Yellow, m_WhitePlatforms[2]);
     }
     else if (m_Color == newColor)
         SetColor(newColor, m_Platform);
     m_IsColorActive = m_Color == eColor.White || m_Color == newColor;
     UpdateCollider();
 }
Beispiel #40
0
 public void ColorObtained(eColor newColor)
 {
     switch (newColor)
     {
     case eColor.Blue:
         IsBlueUnlocked = true;
         ColorShift (newColor);
         break;
     case eColor.Red:
         IsRedUnlocked = true;
         ColorShift (newColor);
         break;
     case eColor.Yellow:
         IsYellowUnlocked = true;
         ColorShift (newColor);
         break;
     default:
         Debug.LogError("Color " + newColor.ToString() + " should not be collectible");
         break;
     }
 }
    public void SetColor(eColor newColor, bool redUnlocked, bool blueUnlocked, bool yellowUnlocked)
    {
        for (int i = 0; i < m_WhitePlatforms.Length; ++i)
            m_WhitePlatforms[i].SetActiveColor(newColor);

        for (int i = 0; i < m_RedPlatforms.Length; ++i)
        {
            m_RedPlatforms[i].SetUnlocked(redUnlocked);
            m_RedPlatforms[i].SetActiveColor(newColor);
        }
        for (int i = 0; i < m_BluePlatforms.Length; ++i)
        {
            m_BluePlatforms[i].SetUnlocked(blueUnlocked);
            m_BluePlatforms[i].SetActiveColor(newColor);
        }
        for (int i = 0; i < m_YellowPlatforms.Length; ++i)
        {
            m_YellowPlatforms[i].SetUnlocked(yellowUnlocked);
            m_YellowPlatforms[i].SetActiveColor(newColor);
        }
    }
Beispiel #42
0
    public void ColorShift(eColor newColor)
    {
        if (currentColor == newColor &&
            newColor != eColor.White)
            return;

        currentColor = newColor;

        m_Manager.SetColor(currentColor, IsRedUnlocked, IsBlueUnlocked, IsYellowUnlocked);
        eColor myNextColor = colorAfter(currentColor);
        eColor nextNextColor = colorAfter(myNextColor);

        if ((myNextColor == eColor.Blue && !IsBlueUnlocked) ||
            (myNextColor == eColor.Red && !IsRedUnlocked) ||
            (myNextColor == eColor.Yellow && !IsYellowUnlocked))
            myNextColor = eColor.White;

        if ((nextNextColor == eColor.Blue && !IsBlueUnlocked) ||
            (nextNextColor == eColor.Red && !IsRedUnlocked) ||
            (nextNextColor == eColor.Yellow && !IsYellowUnlocked))
            nextNextColor = eColor.White;

        if (myNextColor == eColor.White
            && nextNextColor != eColor.White)
        {
            myNextColor = nextNextColor;
            nextNextColor = eColor.White;
        }

        Debug.Log("Next color = " + myNextColor.ToString());
        Debug.Log("Next next color = " + nextNextColor.ToString());
        //if (currentColor != eColor.White)
        cameras.SetNewActiveColor (currentColor, myNextColor, nextNextColor);
        pandaColor.ColorShift(currentColor);
        MusicControl.ChangeMusic (currentColor);
    }
Beispiel #43
0
    public virtual void resetProperties()
    {
        TV_ECOLOR_0			= eColor.WHITE;
        STV_ECOLOR_0		= eColor.WHITE;
        TV_BOOL_0 			= false;
        STV_BOOL_0 			= false;
        TV_CHAR_0			= '\0';
        STV_CHAR_0			= '\0';
        TV_BYTE_0			= 0;
        TV_SBYTE_0			= 0;

        TV_LIST_ECOLOR_0.Clear();
        STV_LIST_ECOLOR_0.Clear();
        TV_LIST_BOOL_0.Clear();
        STV_LIST_BOOL_0.Clear();
        TV_LIST_CHAR_0.Clear();
        STV_LIST_CHAR_0.Clear();
        TV_LIST_BYTE_0.Clear();
        TV_LIST_SBYTE_0.Clear();
        STV_LIST_SBYTE_0.Clear();
    }
Beispiel #44
0
 public void Func_eColorRef(ref eColor par)
 {
     par = eColor.BLUE;
 }
Beispiel #45
0
 public eColor Func_eColorIR(eColor par)
 {
     if(par == eColor.WHITE)
         return eColor.BLUE;
     else
         return eColor.RED;
 }
Beispiel #46
0
        private void getCarColor()
        {
            bool isValidColor = true;

            do
            {
                try
                {
                    m_ColorOfCar = (eColor)parseEnumUserInput(
            @"Please choose the car color from the menu:
            1. Red
            2. Yellow
            3. black
            4. Silver",
            typeof(eColor));

                    isValidColor = Enum.IsDefined(typeof(eColor), m_ColorOfCar);
                    if (!isValidColor)
                    {
                        Console.WriteLine("Invalid color input");
                    }
                }
                catch (ArgumentException ex)
                {
                    isValidColor = false;
                    Console.WriteLine(ex.Message);
                }
                catch (Exception ex)
                {
                    isValidColor = false;
                    Console.WriteLine(ex.Message);
                }
            }
            while (!isValidColor);
        }
Beispiel #47
0
 public void reset() {
     brand = "Volkswage";
     price = 0;
     color = eColor.RED;
 }
Beispiel #48
0
    eColor nextColor(eColor curColor)
    {
        if (!IsRedUnlocked
            && !IsBlueUnlocked
            && !IsYellowUnlocked)
        {
            return eColor.White;
        }

        switch(curColor)
        {
        case eColor.Red:
            if (IsBlueUnlocked)
                return eColor.Blue;
            if (IsYellowUnlocked)
                return eColor.Yellow;
            return eColor.Red;
        case eColor.Blue:
            if (IsYellowUnlocked)
                return eColor.Yellow;
            if (IsRedUnlocked)
                return eColor.Red;
            return eColor.Blue;
        case eColor.Yellow:
            if (IsRedUnlocked)
                return eColor.Red;
            if (IsBlueUnlocked)
                return eColor.Blue;
            return eColor.Yellow;
        }

        return eColor.Black;
    }
Beispiel #49
0
    eColor colorAfter(eColor curColor)
    {
        switch(curColor)
        {
        case eColor.Red:
            return eColor.Blue;
        case eColor.Blue:
            return eColor.Yellow;
        case eColor.Yellow:
            return eColor.Red;
        }

        return eColor.White;
    }
Beispiel #50
0
        public void InsertDetailsOfNewCar(
            string i_InputVehicleModelName, 
            string i_InputWheelManufacturerName, 
            float i_InputVehicleCurrentAmountOfEnergy, 
            float i_InputWheelCurrentAirPressure, 
            eColor i_InputCarColor,
            eAmountOfDoors i_InputCarDoorsNumber)
        {
            Car newCar = m_Vehicle as Car;

            if (newCar != null)
            {
                newCar.ColorOfCar = i_InputCarColor;
                newCar.AmountOfDoorsInCar = i_InputCarDoorsNumber;
                insertDetailsOfNewVehicle(i_InputVehicleModelName, i_InputWheelManufacturerName, i_InputVehicleCurrentAmountOfEnergy, i_InputWheelCurrentAirPressure);
            }
            else
            {
                throw new ArgumentException("The vehicle is not a Car");
            }
        }