示例#1
0
        /*
         * public ScreenChar(char chr)
         * {
         *      Chars = new List<char>();
         *      Char = chr;
         *      Attr = CharAttributes.Message;
         * }
         */

        public ScreenChar(char chr, CharAttributes attr, int ackCount)
        {
            //Chars = new List<char>();
            Char     = chr;
            Attr     = attr;
            AckCount = ackCount;
        }
示例#2
0
 public void DrawRectangle(
     short x,
     short y,
     short width,
     short height,
     CharAttributes brush,
     char asciiChar) => DrawRectangleCore(x, y, width, height, brush, asciiChar);
示例#3
0
 public void ReturnDefaultState(CharAttributes selectedCharAttributes)                // establece un fondo verde claro para el icono
 {
     if (selectedCharAttributes == charAttributes)                                    // determina si el icono debe responder a un evento
     {
         backGround.sprite         = GetComponentInParent <StorageMNG>().defaultIcon; // establece el icono verde claro
         charAttributes.isDeployed = false;                                           // define al héroe como disponible para su despliegue
     }
 }
示例#4
0
 public void LocalOutputEnqueue(char chr, CharAttributes attr, int ackCount)
 {
     _localOutputBuffer.Enqueue(new ScreenChar(chr, attr, ackCount));
     //if (attr == CharAttributes.Recv)
     //{
     //	Debug.WriteLine($"ScreenChar: {chr} {ackCount}");
     //}
 }
 public void ReturnDefaultState(CharAttributes selectedCharAttributes)                //sets light green background to the icon
 {
     if (selectedCharAttributes == charAttributes)                                    //determines if the icon should respond to an event
     {
         backGround.sprite         = GetComponentInParent <StorageMNG>().defaultIcon; //sets light green icon
         charAttributes.isDeployed = false;                                           //defines the hero as available for deployment
     }
 }
示例#6
0
    private void InstantiateEnemy(CharAttributes charAttributes, Image hexPosition)
    {
        Hero enemy = Instantiate(charAttributes.heroSO, hexPosition.transform); // crea una instancia de un enemigo

        enemy.gameObject.AddComponent <Enemy>();                                // agrega el script Enemy a un objeto héroe definido como enemigo

        // adjunta el script AllPosForGroundAI a un objeto héroe definido como enemigo
        enemy.gameObject.AddComponent <AllPosForGroundAI>();
    }
    private void InstantiateEnemy(CharAttributes charAttributes, Image hexPosition)
    {
        Hero enemy = Instantiate(charAttributes.heroSO, hexPosition.transform); //instantiates an enemy

        enemy.gameObject.AddComponent <Enemy>();                                //adds Enemy script to a hero object defined as an enemy

        //attaches the AllPosForGroundAI script to a hero object defined as an enemy
        enemy.gameObject.AddComponent <AllPosForGroundAI>();
    }
示例#8
0
 private void DestroyMe(CharAttributes SOHero) // destruye este objeto
 {
     if (SOHero == heroData)                   // compara la elección del jugador con el héroe
     {
         BattleHex parentHex = GetComponentInParent <BattleHex>();
         parentHex.MakeMeDeploymentPosition();
         startBTN.ControlStartBTN();/// comprueba si es hora de ocultar el botón Inicio
         Destroy(gameObject);
     }
 }
 private void DestroyMe(CharAttributes SOHero) //destroys this object
 {
     if (SOHero == heroData)                   // compares the player’s choice with the hero
     {
         BattleHex parentHex = GetComponentInParent <BattleHex>();
         parentHex.MakeMeDeploymentPosition();
         startBTN.ControlStartBTN();//checks if it's time to hide the Start button
         Destroy(gameObject);
     }
 }
示例#10
0
        private void Awake()
        {
            Transform          = GetComponent <Transform>();
            Rigidbody          = GetComponent <Rigidbody>();
            Collider           = GetComponent <Collider>();
            MeshRenderer       = GetComponent <MeshRenderer>();
            _animator          = GetComponent <Animator>();
            AnimatorParameters = new AnimatorParameters(ref _animator);

            CharAttributes = new CharAttributes();
        }
示例#11
0
 public Range(
     ushort startIndexInclusive,
     ushort endIndexExclusive,
     CharAttributes attributes,
     int delay = 0)
 {
     this.StartIndexInclusive = startIndexInclusive;
     this.EndIndexExclusive   = endIndexExclusive;
     this.Attributes          = attributes;
     this.Delay = delay;
 }
示例#12
0
    // cambia el sprite y muestra pérdidas
    internal void FillIconWhenGameIsOver(CharAttributes Attributes)
    {
        // muestra el sprite del héroe que participó en la batalla
        heroImage.sprite = Attributes.heroSprite;
        // muestra pérdidas
        if (Attributes.Calculatelosses() != 0)
        {
            losses = "- " + Attributes.Calculatelosses();
        }

        stackText.text = losses;
    }
    //changes the sprite and displays losses
    internal void FillIconWhenGameIsOver(CharAttributes Attributes)
    {
        //displays the sprite of the hero who participated in the battle
        heroImage.sprite = Attributes.heroSprite;
        //displays losses
        if (Attributes.Calculatelosses() != 0)
        {
            losses = "- " + Attributes.Calculatelosses();
        }

        stackText.text = losses;
    }
示例#14
0
        public void WriteToConsole(string _string, Coord coord, CharAttributes attributes = CharAttributes.foreground_normal)
        {
            Rect writeRect = new Rect {
                Left = coord.x, Right = 160, Top = coord.y, Bottom = 59
            };

            WriteConsoleOutput(screenBuffer,
                               StringToCharInfo(_string, attributes),
                               new Coord((short)_string.Length, (short)1),
                               new Coord(0, 0),
                               ref writeRect
                               );
        }
示例#15
0
    private void SizeChange(ref CharAttributes cH)
    {
        float curveTime   = 0f;
        float curveAmount = sizeCurve.Evaluate(curveTime);

        while (curveTime < 5.0f)
        {
            curveTime += Time.deltaTime * speedMultiplyer;
            Debug.Log("curveTime: " + curveTime);
            curveAmount = sizeCurve.Evaluate(curveTime);
            Debug.Log("cureveAmount: " + curveAmount);
            //cH.ReSize(curveAmount);
            cH.size += 1;
            Debug.Log("cHSize" + cH.size);
            if (Input.GetKeyDown(KeyCode.M))
            {
                break;
            }
        }
    }
示例#16
0
        public static CharInfo[,] StringToCharInfo(string _string, CharAttributes attributes = CharAttributes.empty)
        {
            int x = 0, y = 0;

            // CHANGE IF YOU WANT TO HAVE EXTRA LINES
            CharInfo[,] charReturn = new CharInfo[_string.Length, 1];

            foreach (char _char in _string.ToCharArray())
            {
                if (_char != '\n')
                {
                    charReturn[x++, y] = new CharInfo(_char, attributes);
                }
                else
                {
                    y++;
                    continue;
                }
            }

            return(charReturn);
        }
示例#17
0
 public static extern bool FillConsoleOutputAttribute([In] IntPtr hConsoleOutput, [In] CharAttributes wAttribute, [In] uint nLength, [In] Coord dwWriteCoord, [Out] out uint lpNumberOfAttrsWritten);
示例#18
0
 public CharInfo(char unicodeChar, CharAttributes attributes)
 {
     UnicodeChar = unicodeChar;
     Attributes  = attributes;
 }
示例#19
0
        public static CharAttributes MakeCharAttributes(ConsoleColor color, ConsoleColor backgroundColor)
        {
            CharAttributes attributes = 0;

            switch (color)
            {
            case ConsoleColor.DarkGray:
                attributes |= CharAttributes.ForegroundIntensity;
                break;

            case ConsoleColor.Gray:
                attributes |= CharAttributes.ForegroundRed | CharAttributes.ForegroundGreen | CharAttributes.ForegroundBlue;
                break;

            case ConsoleColor.DarkBlue:
                attributes |= CharAttributes.ForegroundBlue;
                break;

            case ConsoleColor.DarkGreen:
                attributes |= CharAttributes.ForegroundGreen;
                break;

            case ConsoleColor.DarkCyan:
                attributes |= CharAttributes.ForegroundGreen | CharAttributes.ForegroundBlue;
                break;

            case ConsoleColor.DarkRed:
                attributes |= CharAttributes.ForegroundRed;
                break;

            case ConsoleColor.DarkMagenta:
                attributes |= CharAttributes.ForegroundRed | CharAttributes.ForegroundBlue;
                break;

            case ConsoleColor.DarkYellow:
                attributes |= CharAttributes.ForegroundRed | CharAttributes.ForegroundGreen;
                break;

            case ConsoleColor.White:
                attributes |= CharAttributes.ForegroundRed | CharAttributes.ForegroundGreen | CharAttributes.ForegroundBlue | CharAttributes.ForegroundIntensity;
                break;

            case ConsoleColor.Blue:
                attributes |= CharAttributes.ForegroundBlue | CharAttributes.ForegroundIntensity;
                break;

            case ConsoleColor.Green:
                attributes |= CharAttributes.ForegroundGreen | CharAttributes.ForegroundIntensity;
                break;

            case ConsoleColor.Cyan:
                attributes |= CharAttributes.ForegroundGreen | CharAttributes.ForegroundBlue | CharAttributes.ForegroundIntensity;
                break;

            case ConsoleColor.Red:
                attributes |= CharAttributes.ForegroundRed | CharAttributes.ForegroundIntensity;
                break;

            case ConsoleColor.Magenta:
                attributes |= CharAttributes.ForegroundRed | CharAttributes.ForegroundBlue | CharAttributes.ForegroundIntensity;
                break;

            case ConsoleColor.Yellow:
                attributes |= CharAttributes.ForegroundRed | CharAttributes.ForegroundGreen | CharAttributes.ForegroundIntensity;
                break;
            }

            switch (backgroundColor)
            {
            case ConsoleColor.DarkGray:
                attributes |= CharAttributes.BackgroundIntensity;
                break;

            case ConsoleColor.Gray:
                attributes |= CharAttributes.BackgroundRed | CharAttributes.BackgroundGreen | CharAttributes.BackgroundBlue;
                break;

            case ConsoleColor.DarkBlue:
                attributes |= CharAttributes.BackgroundBlue;
                break;

            case ConsoleColor.DarkGreen:
                attributes |= CharAttributes.BackgroundGreen;
                break;

            case ConsoleColor.DarkCyan:
                attributes |= CharAttributes.BackgroundGreen | CharAttributes.BackgroundBlue;
                break;

            case ConsoleColor.DarkRed:
                attributes |= CharAttributes.BackgroundRed;
                break;

            case ConsoleColor.DarkMagenta:
                attributes |= CharAttributes.BackgroundRed | CharAttributes.BackgroundBlue;
                break;

            case ConsoleColor.DarkYellow:
                attributes |= CharAttributes.BackgroundRed | CharAttributes.BackgroundGreen;
                break;

            case ConsoleColor.White:
                attributes |= CharAttributes.BackgroundRed | CharAttributes.BackgroundGreen | CharAttributes.BackgroundBlue | CharAttributes.BackgroundIntensity;
                break;

            case ConsoleColor.Blue:
                attributes |= CharAttributes.BackgroundBlue | CharAttributes.BackgroundIntensity;
                break;

            case ConsoleColor.Green:
                attributes |= CharAttributes.BackgroundGreen | CharAttributes.BackgroundIntensity;
                break;

            case ConsoleColor.Cyan:
                attributes |= CharAttributes.BackgroundGreen | CharAttributes.BackgroundBlue | CharAttributes.BackgroundIntensity;
                break;

            case ConsoleColor.Red:
                attributes |= CharAttributes.BackgroundRed | CharAttributes.BackgroundIntensity;
                break;

            case ConsoleColor.Magenta:
                attributes |= CharAttributes.BackgroundRed | CharAttributes.BackgroundBlue | CharAttributes.BackgroundIntensity;
                break;

            case ConsoleColor.Yellow:
                attributes |= CharAttributes.BackgroundRed | CharAttributes.BackgroundGreen | CharAttributes.BackgroundIntensity;
                break;
            }

            return(attributes);
        }
示例#20
0
 public void RemoveRegiment(CharAttributes SOHero)//calls OnRemoveHero event
 {
     OnClickOnGrayIcon(SOHero);
 }
示例#21
0
 public void DrawRectangle(
     short x,
     short y,
     short width,
     short height,
     CharAttributes brush) => DrawRectangleCore(x, y, width, height, brush, null);
示例#22
0
 public void Write(short x, short y, string text, CharAttributes brush) => WriteCore(x, y, text, brush);
示例#23
0
 public void Paint(short x, short y, CharAttributes brush) => Canvas[y, x].Attributes = brush;
示例#24
0
 public TerminalBufferChar(char c, CharAttributes attr)
 {
     Char       = c;
     Attributes = attr;
 }
示例#25
0
 public CharColors(ConsoleColor fg, ConsoleColor bg)
 {
     this.attributes = (CharAttributes)(((ushort)bg << 4) | (ushort)fg);
     this.Foreground = fg;
     this.Background = bg;
 }
示例#26
0
 public CharInfo(CharUnion @char)
 {
     this.Char       = @char;
     this.Attributes = DefaultAttributes;
 }
示例#27
0
 public CharInfo(CharUnion @char, CharAttributes attributes)
 {
     this.Char       = @char;
     this.Attributes = attributes;
 }
示例#28
0
 public CharInfo(char _char, CharAttributes attributes = CharAttributes.empty)
 {
     UnicodeChar = _char;
     AsciiChar   = _char;
     Attributes  = (ushort)attributes;
 }
示例#29
0
 public static extern bool SetConsoleTextAttribute([In] IntPtr hConsoleOutput, [In] CharAttributes wAttributes);
示例#30
0
 public TerminalTag(string text, CharAttributes attributes)
 {
     Text       = text;
     Attributes = attributes;
 }