本文整理汇总了C#中HaCreator.MapEditor.Board类的典型用法代码示例。如果您正苦于以下问题:C# Board类的具体用法?C# Board怎么用?C# Board使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Board类属于HaCreator.MapEditor命名空间,在下文中一共展示了Board类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ClearBoundItems
public static void ClearBoundItems(Board board)
{
object[] keys = new object[board.Mouse.BoundItems.Count];
//int i = 0;
board.Mouse.BoundItems.Keys.CopyTo(keys, 0);
/*foreach (DictionaryEntry entry in board.Mouse.BoundItems)
{
keys[i] = entry.Key;
i++;
}*/
List<UndoRedoAction> undoActions = new List<UndoRedoAction>();
bool addUndo;
foreach (object key in keys)
{
BoardItem item = (BoardItem)key;
addUndo = item.tempParent == null || !(item.tempParent.Parent is Mouse);
board.Mouse.ReleaseItem(item);
if (addUndo)
{
if ((item is BackgroundInstance) && (((BackgroundInstance)item).BaseX != item.moveStartPos.X || ((BackgroundInstance)item).BaseY != item.moveStartPos.Y))
undoActions.Add(UndoRedoManager.BackgroundMoved((BackgroundInstance)item, new Point(item.moveStartPos.X, item.moveStartPos.Y), new Point(((BackgroundInstance)item).BaseX, ((BackgroundInstance)item).BaseY)));
else if (!(item is BackgroundInstance) && (item.X != item.moveStartPos.X || item.Y != item.moveStartPos.Y))
undoActions.Add(UndoRedoManager.ItemMoved(item, new Point(item.moveStartPos.X, item.moveStartPos.Y), new Point(item.X, item.Y)));
}
}
if (undoActions.Count > 0)
board.UndoRedoMan.AddUndoBatch(undoActions);
}
示例2: ClearSelectedItems
public static void ClearSelectedItems(Board board)
{
while (board.SelectedItems.Count > 0)
{
board.SelectedItems[0].Selected = false;
}
}
示例3: Layer
public Layer(Board board)
{
this.board = board;
if (board.Layers.Count == 10) throw new NotSupportedException("Cannot add more than 10 layers (why would you need that much anyway?)");
num = board.Layers.Count;
board.Layers.Add(this);
}
示例4: MassZmEditor
public MassZmEditor(IContainsLayerInfo[] items, Board board, int zm)
{
InitializeComponent();
this.items = items;
this.board = board;
zmInput.Value = zm;
}
示例5: BoardItemContextMenu
public BoardItemContextMenu(MultiBoard multiboard, Board board, BoardItem target)
{
this.multiboard = multiboard;
this.board = board;
this.target = target;
this.cms = null;
}
示例6: GenerateDefaultZms
public static void GenerateDefaultZms(Board mapBoard)
{
// generate default zM's
HashSet<int> allExistingZMs = new HashSet<int>();
foreach (Layer l in mapBoard.Layers)
{
l.RecheckTileSet();
l.RecheckZM();
l.zMList.ToList().ForEach(y => allExistingZMs.Add(y));
}
for (int i = 0; i < mapBoard.Layers.Count; i++)
{
for (int zm_cand = 0; mapBoard.Layers[i].zMList.Count == 0; zm_cand++)
{
// Choose a zM that is free
if (!allExistingZMs.Contains(zm_cand))
{
mapBoard.Layers[i].zMList.Add(zm_cand);
allExistingZMs.Add(zm_cand);
break;
}
}
}
}
示例7: BoardItemsManager
public BoardItemsManager(Board board)
{
AllItemLists = new IMapleList[] { BackBackgrounds, TileObjs, Mobs, NPCs, Reactors, Portals, FrontBackgrounds, FootholdLines, RopeLines, FHAnchors, RopeAnchors, Chairs, CharacterToolTips, ToolTips, ToolTipDots, MiscItems, SpecialDots };
this.board = board;
Items = new BoardItemsCollection(this, true);
Lines = new MapleLinesCollection(this, false);
}
示例8: TnSelector
public TnSelector(Board board)
{
InitializeComponent();
foreach (PortalInstance pi in board.BoardItems.Portals)
{
if (pi.pn != null && pi.pn != "" && pi.pn != "sp" && pi.pn != "pt")
pnList.Items.Add(pi.pn);
}
}
示例9: TnSelector
public TnSelector(Board board)
{
InitializeComponent();
styleManager.ManagerStyle = UserSettings.applicationStyle;
foreach (PortalInstance pi in board.BoardItems.Portals)
{
if (pi.pn != null && pi.pn != "" && pi.pn != "sp" && pi.pn != "pt")
pnList.Items.Add(pi.pn);
}
}
示例10: checkConnected
public static void checkConnected(Board mapBoard)
{
/*\
* This is not used yet, I was making it for putting the FHs in separate groups
* but lost my train of thought -DeathRight
\*/
foreach (FootholdLine fhline in mapBoard.BoardItems.FootholdLines)
{
foreach (FootholdLine connectedLine in fhline.FirstDot.connectedLines)
{
}
}
}
示例11: VREditor
public VREditor(Board mapBoardd)
{
InitializeComponent();
styleManager.ManagerStyle = UserSettings.applicationStyle;
mapBoard = mapBoardd;
VROld = (Rectangle)mapBoard.MapInfo.VR;
miniMap.Image = mapBoardd.MiniMap;
miniMap.Update();
miniMap.Refresh();
//Rectangle VR = new Rectangle(miniMap.Location.X - (mapBoard.MapInfo.VR.Value.X / 4), miniMap.Location.Y - (mapBoard.MapInfo.VR.Value.Y / 4), miniMap.Width - (mapBoard.MapInfo.VR.Value.Width / 4), miniMap.Height - (mapBoard.MapInfo.VR.Value.Height / 4));
//VR.Location = miniMap.Location;
}
示例12: Save
public Save(Board board)
{
this.board = board;
InitializeComponent();
switch (board.MapInfo.mapType)
{
case MapType.CashShopPreview:
case MapType.MapLogin:
idBox.Text = board.MapInfo.strMapName;
break;
case MapType.RegularMap:
idBox.Text = board.MapInfo.id == -1 ? "" : board.MapInfo.id.ToString();
break;
default:
throw new NotSupportedException("Unknown map type at Save::.ctor()");
}
idBox_TextChanged(null, null);
}
示例13: ObjectInstance
//private int zM;
public ObjectInstance(ObjectInfo baseInfo, Layer layer, Board board, int x, int y, int z, MapleBool r, MapleBool hide, MapleBool reactor, MapleBool flow, int? rx, int? ry, int? cx, int? cy, string name, string tags, List<ObjectInstanceQuest> questInfo, bool flip, bool beforeAdding)
: base(board, layer, x, y, z, beforeAdding)
{
this.baseInfo = baseInfo;
this.flip = flip;
this._r = r;
this.name = name;
this._hide = hide;
this._reactor = reactor;
this._flow = flow;
this._rx = rx;
this._ry = ry;
this._cx = cx;
this._cy = cy;
this._tags = tags;
this.questInfo = questInfo;
//this.zM = zM;
if (flip)
X -= Width - 2 * Origin.X;
}
示例14: MiscRectangle
public MiscRectangle(Board board, Rectangle rect)
: base(board, rect)
{
PointA = new MiscDot(this, board, rect.Left, rect.Top, false);
PointB = new MiscDot(this, board, rect.Right, rect.Top, false);
PointC = new MiscDot(this, board, rect.Right, rect.Bottom, false);
PointD = new MiscDot(this, board, rect.Left, rect.Bottom, false);
board.BoardItems.ToolTipDots.Add((ToolTipDot)PointA);
board.BoardItems.ToolTipDots.Add((ToolTipDot)PointB);
board.BoardItems.ToolTipDots.Add((ToolTipDot)PointC);
board.BoardItems.ToolTipDots.Add((ToolTipDot)PointD);
LineAB = new MiscLine(board, PointA, PointB);
LineBC = new MiscLine(board, PointB, PointC);
LineCD = new MiscLine(board, PointC, PointD);
LineDA = new MiscLine(board, PointD, PointA);
LineAB.yBind = true;
LineBC.xBind = true;
LineCD.yBind = true;
LineDA.xBind = true;
}
示例15: LayerChange
public LayerChange(List<BoardItem> items, Board board)
{
this.items = items;
this.board = board;
InitializeComponent();
board.Layers.ForEach(x => layerBox.Items.Add(x.ToString()));
if (board.SelectedLayerIndex == -1)
{
layerBox.SelectedIndex = 0;
zmBox.SelectedIndex = 0;
}
else
{
layerBox.SelectedIndex = board.SelectedLayerIndex;
if (board.SelectedPlatform != -1)
{
zmBox.SelectedItem = board.SelectedPlatform;
}
}
}