Beispiel #1
0
 public TabStop(float position, IDrawInterface leader, Alignment alignment, char anchorChar)
 {
     this.position = position;
     this.leader = leader;
     this.alignment = alignment;
     this.anchorChar = anchorChar;
 }
Beispiel #2
0
 public TabStop(float position, IDrawInterface leader, Alignment alignment, char anchorChar)
 {
     this.position   = position;
     this.leader     = leader;
     this.alignment  = alignment;
     this.anchorChar = anchorChar;
 }
Beispiel #3
0
 /**
  * Creates a tab Chunk.
  * Note that separator chunks can't be used in combination with tab chunks!
  * @param   separator   the drawInterface to use to draw the tab.
  * @param   tabPosition an X coordinate that will be used as start position for the next Chunk.
  * @param   newline     if true, a newline will be added if the tabPosition has already been reached.
  * @since   2.1.2
  */
 public Chunk(IDrawInterface separator, float tabPosition, bool newline) : this(OBJECT_REPLACEMENT_CHARACTER, new Font())
 {
     if (tabPosition < 0)
     {
         throw new ArgumentException(MessageLocalization.GetComposedMessage("a.tab.position.may.not.be.lower.than.0.yours.is.1", tabPosition));
     }
     SetAttribute(TAB, new Object[] { separator, tabPosition, newline, 0 });
 }
Beispiel #4
0
 /**
  * Creates a tab Chunk.
  * Note that separator chunks can't be used in combination with tab chunks!
  * @param   separator   the drawInterface to use to draw the tab.
  * @param   tabPosition an X coordinate that will be used as start position for the next Chunk.
  * @param   newline     if true, a newline will be added if the tabPosition has already been reached.
  * @since   2.1.2
  */
 public Chunk(IDrawInterface separator, float tabPosition, bool newline) : this(OBJECT_REPLACEMENT_CHARACTER, new Font())
 {
     if (tabPosition < 0)
     {
         throw new ArgumentException("A tab position may not be lower than 0; yours is " + tabPosition);
     }
     SetAttribute(TAB, new Object[] { separator, tabPosition, newline, 0 });
 }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="mapResolution"></param>
        /// <param name="mapSizeX"></param>
        /// <param name="mapSizeY"></param>
        /// <param name="startCoords"></param>
        /// <param name="multiResSize"></param>
        /// <param name="drawInterface"></param>
        /// <param name="debugInterface"></param>
        public HectorSLAMProcessor(float mapResolution, int mapSizeX, int mapSizeY, Vector2 startCoords, int multiResSize, IDrawInterface drawInterface = null, IHectorDebugInfo debugInterface = null)
        {
            this.drawInterface  = drawInterface;
            this.debugInterface = debugInterface;

            MapRep = new MapRepMultiMap(mapResolution, mapSizeX, mapSizeY, multiResSize, startCoords, drawInterface, debugInterface);

            Reset();

            MinDistanceDiffForMapUpdate = 0.4f * 1.0f;
            MinAngleDiffForMapUpdate    = 0.13f * 1.0f;
        }
Beispiel #6
0
 private void stateFullscreenToolStripMenuItem_Click(object sender, EventArgs e)
 {
     // selected "State FullScreen" in context menu
     if (gameContext.Threads != null)
     {
         drawObj = new drawFullScreen(gameContext, PropertiesOfElements);
         drawObj.createState((int)gameContext.Threads[0].MID);
         this.TreeOfStates.SelectedIndex = (int)countStates - 1;
     }
     else
     {
         // If the game is not created still
         gameContext.init();
         gameContext.Threads.Add(new thread());
         drawObj = new drawFullScreen(gameContext, PropertiesOfElements);
         drawObj.createState((int)gameContext.Threads[0].MID);
         this.TreeOfStates.SelectedIndex = (int)countStates - 1;
     }
 }
Beispiel #7
0
 /**
  * Creates a separator Chunk.
  * Note that separator chunks can't be used in combination with tab chunks!
  * @param   separator   the drawInterface to use to draw the separator.
  * @param   vertical    true if this is a vertical separator
  * @since   2.1.2
  */
 public Chunk(IDrawInterface separator, bool vertical) : this(OBJECT_REPLACEMENT_CHARACTER, new Font())
 {
     SetAttribute(SEPARATOR, new Object[] { separator, vertical });
     this.role = null;
 }
Beispiel #8
0
 public MapRepSingleMap(float mapResolution, IDrawInterface drawInterface, IHectorDebugInfo debugInterface)
 {
     gridMap     = new GridMap(mapResolution, new Point(1024, 1024), new Vector2(20.0f, 20.0f));
     gridMapUtil = new OccGridMapUtilConfig(gridMap);
     scanMatcher = new ScanMatcher(drawInterface, debugInterface);
 }
Beispiel #9
0
 /**
  * Creates a separator Chunk.
  * Note that separator chunks can't be used in combination with tab chunks!
  * @param   separator   the drawInterface to use to draw the separator.
  * @since   2.1.2
  */
 public Chunk(IDrawInterface separator) : this(separator, false)
 {
 }
Beispiel #10
0
 public TabStop(float position, IDrawInterface leader) : this(position, leader, Alignment.LEFT)
 {
 }
Beispiel #11
0
 public TabStop(float position, IDrawInterface leader, Alignment alignment)
     : this(position, leader, alignment, '.')
 {
 }
Beispiel #12
0
 public Chunk(IDrawInterface separator, float tabPosition, bool newline) : this(OBJECT_REPLACEMENT_CHARACTER, new Font()) {
     if (tabPosition < 0) {
         throw new ArgumentException(MessageLocalization.GetComposedMessage("a.tab.position.may.not.be.lower.than.0.yours.is.1", tabPosition));
     }
     SetAttribute(TAB, new Object[] { separator, tabPosition, newline, 0 });
     this.role = null;
 }
Beispiel #13
0
        public MapRepMultiMap(float mapResolution, int mapSizeX, int mapSizeY, int numDepth, Vector2 startCoords, IDrawInterface drawInterface, IHectorDebugInfo debugInterface)
        {
            //unsigned int numDepth = 3;
            Point resolution = new Point(mapSizeX, mapSizeY);

            float totalMapSizeX = mapResolution * mapSizeX;
            float mid_offset_x  = totalMapSizeX * startCoords.X;

            float totalMapSizeY = mapResolution * mapSizeY;
            float mid_offset_y  = totalMapSizeY * startCoords.Y;

            mapContainer   = new List <MapProcContainer>();
            dataContainers = new List <DataContainer>(numDepth - 1);

            for (int i = 0; i < numDepth; ++i)
            {
                System.Diagnostics.Debug.WriteLine($"HectorSM map lvl {i}: cellLength: {mapResolution} res x: {resolution.X} res y: {resolution.Y}");
                GridMap gridMap = new GridMap(mapResolution, resolution, new Vector2(mid_offset_x, mid_offset_y));
                OccGridMapUtilConfig gridMapUtil = new OccGridMapUtilConfig(gridMap);
                ScanMatcher          scanMatcher = new ScanMatcher(drawInterface, debugInterface);

                mapContainer.Add(new MapProcContainer(gridMap, gridMapUtil, scanMatcher));

                resolution     = new Point(resolution.X / 2, resolution.Y / 2);
                mapResolution *= 2.0f;
            }
        }
Beispiel #14
0
 /**
 * Creates a separator Chunk.
 * Note that separator chunks can't be used in combination with tab chunks!
 * @param   separator   the drawInterface to use to draw the separator.
 * @param   vertical    true if this is a vertical separator
 * @since   2.1.2
 */
 public Chunk(IDrawInterface separator, bool vertical) : this(OBJECT_REPLACEMENT_CHARACTER, new Font()) {
     SetAttribute(SEPARATOR, new Object[] {separator, vertical});
     this.role = null;
 }
Beispiel #15
0
 public Chunk(IDrawInterface separator, float tabPosition) : this(separator, tabPosition, false)
 {
 }
Beispiel #16
0
        private void listBox2_SelectedIndexChanged(object sender, EventArgs e)
        {
            int selectedIndex = TreeOfStates.SelectedIndex;

            if (!flagSavedState)
            {
                Button saveButton = (Button)PropertiesOfElements.Controls.Find("saveButton", false).FirstOrDefault();
                if (saveButton != null)
                {
                    saveButton.PerformClick();
                }
                flagSavedState             = true;
                TreeOfStates.SelectedIndex = selectedIndex;
            }
            else
            {
                // this method not effective. need rewrite this code
                AState selectedState;
                char   type = TreeOfStates.SelectedItem.ToString()[1];
                PropertiesOfElements.Controls.Clear();
                // find selected state
                uint index = indexTreeOfStateToIDOfState[TreeOfStates.SelectedIndex];
                foreach (thread th in gameContext.Threads)
                {
                    foreach (KeyValuePair <uint?, IState> st in th.MIDToIState)
                    {
                        if (index == st.Value.getID())
                        {
                            selectedState = (AState)st.Value;
                            // draw interface
                            switch (type)
                            {
                            case 'D':
                                drawObj = new drawDialogue(gameContext, PropertiesOfElements);
                                break;

                            case 'W':
                                drawObj = new drawWait(gameContext, PropertiesOfElements);
                                break;

                            case 'E':
                                break;

                            case 'C':
                                drawObj = new drawChoice(gameContext, PropertiesOfElements);
                                break;

                            case 'I':
                                drawObj = new drawImage(gameContext, PropertiesOfElements);
                                break;

                            case 'F':
                                drawObj = new drawFullScreen(gameContext, PropertiesOfElements);
                                break;
                            }
                            drawObj.drawInterface(selectedState);
                            break;
                        }
                    }
                }
                flagSavedState = false;
            }
        }
Beispiel #17
0
 /**
 * Creates a tab Chunk.
 * Note that separator chunks can't be used in combination with tab chunks!
 * @param   separator   the drawInterface to use to draw the tab.
 * @param   tabPosition an X coordinate that will be used as start position for the next Chunk.
 * @param   newline     if true, a newline will be added if the tabPosition has already been reached.
 * @since   2.1.2
 */
 public Chunk(IDrawInterface separator, float tabPosition, bool newline)
     : this(OBJECT_REPLACEMENT_CHARACTER, new Font())
 {
     if (tabPosition < 0) {
         throw new ArgumentException("A tab position may not be lower than 0; yours is " + tabPosition);
     }
     SetAttribute(TAB, new Object[] {separator, tabPosition, newline, 0});
 }
 /**
  * Creates a vertical position mark that won't draw anything unless
  * you define a DrawInterface.
  * @param   drawInterface   the drawInterface for this vertical position mark.
  * @param   offset          the offset for this vertical position mark.
  */
 public VerticalPositionMark(IDrawInterface drawInterface, float offset)
 {
     this.drawInterface = drawInterface;
     this.offset        = offset;
 }
Beispiel #19
0
 /**
 * Creates a separator Chunk.
 * Note that separator chunks can't be used in combination with tab chunks!
 * @param   separator   the drawInterface to use to draw the separator.
 * @since   2.1.2
 */
 public Chunk(IDrawInterface separator) : this(separator, false) {
 }   
Beispiel #20
0
 public TabStop(float position, IDrawInterface leader) : this(position, leader, Alignment.LEFT)
 {
 }
Beispiel #21
0
 public Chunk(IDrawInterface separator, float tabPosition) : this(separator, tabPosition, false) {
 }
Beispiel #22
0
 public TabStop(float position, IDrawInterface leader, Alignment alignment)
     : this(position, leader, alignment, '.')
 {
 }
 /**
 * Creates a vertical position mark that won't draw anything unless
 * you define a DrawInterface.
 * @param   drawInterface   the drawInterface for this vertical position mark.
 * @param   offset          the offset for this vertical position mark.
 */
 public VerticalPositionMark(IDrawInterface drawInterface, float offset) {
     this.drawInterface = drawInterface;
     this.offset = offset;
 }
Beispiel #24
0
 public ScanMatcher(IDrawInterface drawInterface = null, IHectorDebugInfo debugInterface = null)
 {
     this.drawInterface  = drawInterface;
     this.debugInterface = debugInterface;
 }