Esempio n. 1
0
 public NodeGene(TypeE type, int innovation, float x, int y)
 {
     Type       = type;
     Innovation = innovation;
     X          = x;
     Y          = y;
 }
Esempio n. 2
0
 public Macro(TypeE t, List <string> mmml, string name = "")
 {
     type      = t;
     this.mmml = mmml;
     this.name = name;
     remove_macro_symbols();
 }
Esempio n. 3
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="eOriginalPiece">   Piece which has been eaten if any</param>
 /// <param name="iStartPos">        Starting position</param>
 /// <param name="iEndPos">          Ending position</param>
 /// <param name="eType">            Move type</param>
 public Move(ChessBoard.PieceE eOriginalPiece, int iStartPos, int iEndPos, TypeE eType)
 {
     OriginalPiece = eOriginalPiece;
     StartPos      = (byte)iStartPos;
     EndPos        = (byte)iEndPos;
     Type          = eType;
 }
 private void Invoke(TypeE type, TV value)
 {
     try { this.OnDictionaryChanged?.Invoke(this, new DictChangedEventArgs <TK, TV> {
             Type = type, Value = value
         }); } catch (Exception e) {
         Console.WriteLine(e);
     }
 }
Esempio n. 5
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="protoLabel"></param>
    /// <param name="hierarchyContainer"></param>
    /// <param name="newType"></param>
    /// <param name="newSide"></param>
    /// <param name="borderPos">Position of border of graph along which the label should be aligned. </param>
    /// <param name="textHeight"></param>
    /// <param name="text"></param>
    public Label(GameObject protoLabel, GameObject hierarchyContainer, Label.TypeE newType, Label.SideE newSide, Vector3 borderPos, float textHeight, string text)
    {
        Quaternion rotation = newType == TypeE.row ? Quaternion.Euler(90, 0, 0) : Quaternion.Euler(90, 90, 0);

        gameObj = Object.Instantiate(protoLabel, borderPos, rotation);

        textMesh = gameObj.GetComponent <TextMeshPro>();
        if (textMesh == null)
        {
            Debug.LogError("Failed to get TextMeshPro for new Label");
            Object.Destroy(gameObj);
            return;
        }

        //Add the label to the graph container object for easier manipulation and a cleaner scene hierarchy
        gameObj.transform.SetParent(hierarchyContainer.transform);

        Text = text;
        type = newType;
        side = newSide;

        //For left-side and top-side labels, the position that gets passed in is the edge of graph, so we have to account for
        // the width of the text box
        if (side == SideE.leftOrTop)
        {
            Vector3 newPos = gameObj.transform.position;
            if (type == TypeE.row)
            {
                newPos.x -= textMesh.rectTransform.rect.width;
            }
            else
            {
                newPos.z += textMesh.rectTransform.rect.width;
            }
            gameObj.transform.position = newPos;
        }

        //Set the alignment based on right/left, top/bottom
        textMesh.alignment = side == SideE.rightOrBottom ? TextAlignmentOptions.MidlineLeft : TextAlignmentOptions.MidlineRight;

        //Set the height of the text box (i.e. the 2D box in which the region is drawn, regardless of its world orientation)
        SetTextHeight(textHeight);
    }
Esempio n. 6
0
 public MultiConstructorType(TypeE e)
 {
 }
Esempio n. 7
0
 public MultiConstructorType(TypeA a, TypeB b, TypeC c, TypeD d, TypeE e)
 {
 }
Esempio n. 8
0
 public MultiConstructorType(TypeE e)
 {
 }
Esempio n. 9
0
 public MultiConstructorType(TypeA a, TypeB b, TypeC c, TypeD d, TypeE e)
 {
 }
Esempio n. 10
0
 /// <summary>
 /// Creates new command with specified parameters
 /// </summary>
 /// <param name="name">Defnies the name of command</param>
 /// <param name="content">Defines command keyword in movemaster language</param>
 /// <param name="description">Describes command [not mandatory]</param>
 /// <param name="regex">Defines valid syntax of command [not mandatory]</param>
 /// <param name="type">The type.</param>
 /// <returns></returns>
 /// <exception cref="System.ArgumentException">Invalid arguments were passed</exception>
 public static Command CreateCommand(string name, string content, string description, Regex regex, TypeE type)
 {
     if (ValidateData(name, content, description, regex))
     {
         var command = new Command
         {
             Name        = name,
             Content     = content,
             Description = description,
             Regex       = regex,
             Type        = type
         };
         return(command);
     }
     throw new ArgumentException("Invalid arguments were passed");
 }
Esempio n. 11
0
 private void Interrupt(TypeE e)
 {
     this.OnStreamChanged?.Invoke(this, e);
 }
Esempio n. 12
0
 private void InitEmpty()
 {
     type     = TypeE.undefined;
     side     = SideE.undefined;
     textMesh = null;
 }