本文整理汇总了C#中HaloMap.Map.Map类的典型用法代码示例。如果您正苦于以下问题:C# Map类的具体用法?C# Map怎么用?C# Map使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Map类属于HaloMap.Map命名空间,在下文中一共展示了Map类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: argb_color
/// <summary>
/// Creates a color wheel with associated (A)RGB text boxes
/// </summary>
/// <param name="meta"></param>
/// <param name="iEntName">Control display name</param>
/// <param name="map"></param>
/// <param name="iOffsetInChunk"></param>
/// <param name="hasAlphaChannel">True if ARGB, False for RGB</param>
/// <param name="valueType">Float for 0f-1f, Int for 0-255</param>
/// <param name="iLineNumber"></param>
public argb_color(Meta meta, string iEntName, Map map, int iOffsetInChunk, bool hasAlphaChannel, IFPIO.ObjectEnum valueType,int iLineNumber)
{
InitializeComponent();
this.meta = meta;
this.LineNumber = iLineNumber;
this.chunkOffset = iOffsetInChunk;
this.map = map;
this.EntName = " " + iEntName + " ";
this.Dock = DockStyle.Top;
this.Controls[0].Text = EntName;
this.hasAlpha = hasAlphaChannel;
this.ValueType = valueType;
switch (valueType)
{
case IFPIO.ObjectEnum.Byte:
this.eachSize = 1;
break;
case IFPIO.ObjectEnum.Short:
case IFPIO.ObjectEnum.UShort:
this.eachSize = 2;
break;
case IFPIO.ObjectEnum.Int:
case IFPIO.ObjectEnum.UInt:
case IFPIO.ObjectEnum.Float:
case IFPIO.ObjectEnum.Unknown:
this.eachSize = 4;
break;
}
this.size = (hasAlpha ? eachSize * 4 : eachSize * 3);
CW = new ColorWheel();
CW.Location = new Point(180, 5);
Red = new DataValues(meta, "Red", map, iOffsetInChunk, valueType, iLineNumber);
Red.BackColor = System.Drawing.Color.DarkRed;
CW.setTextBox(Red.textBox1, Color.Red);
Blue = new DataValues(meta, "Blue", map, iOffsetInChunk + eachSize, valueType, iLineNumber);
Blue.BackColor = System.Drawing.Color.DarkBlue;
CW.setTextBox(Blue.textBox1, Color.Blue);
Green = new DataValues(meta, "Green", map, iOffsetInChunk + eachSize * 2, valueType, iLineNumber);
Green.BackColor = System.Drawing.Color.FromArgb(10, 80, 35);
CW.setTextBox(Green.textBox1, Color.Green);
if (hasAlpha)
{
Alpha = new DataValues(meta, "Alpha", map, iOffsetInChunk + eachSize * 3, valueType, iLineNumber);
Alpha.BackColor = System.Drawing.Color.Gray;
CW.setTextBox(Alpha.textBox1, Color.White);
gbRGBColor.Controls.Add(Alpha);
}
gbRGBColor.Controls.Add(CW);
CW.BringToFront();
gbRGBColor.Controls.Add(Green);
gbRGBColor.Controls.Add(Blue);
gbRGBColor.Controls.Add(Red);
}
示例2: LoadVariables
/// <summary>
/// The load variables.
/// </summary>
/// <param name="map">The map index.</param>
/// <param name="entlineNumber">The entline number.</param>
/// <remarks></remarks>
public void LoadVariables(Map map, int entlineNumber)
{
this.map = map;
this.lineNumber = entlineNumber;
// FilterEntItems();
}
示例3: ListEntItems
/// <summary>
/// Initializes a new instance of the <see cref="ListEntItems"/> class.
/// </summary>
/// <param name="imap">The imap.</param>
/// <param name="entItems">The ent items.</param>
/// <remarks></remarks>
public ListEntItems(Map imap, IFPIO entItems)
{
if (imap.SelectedMeta == null)
{
this.Close();
}
this.Ent = entItems;
this.map = imap;
InitializeComponent();
this.EntItemsTreeView.Nodes.AddRange(LoadEntItemsIntoTreeView(0));
this.buttGoTo.Tag = this.Ent.ENTElements[0];
DialogResult DR =
MessageBox.Show(
"No N00bs Beyond This Point.....That Is IF You Want To Keep Working Plugins.....",
string.Empty,
MessageBoxButtons.OKCancel);
if (DR == DialogResult.Cancel)
{
MessageBox.Show(
"You have taken the first step in the NA (N00bs Anonymous) program. Please continue down the path to becoming 1337");
this.Close();
}
this.combType.Items.AddRange(Enum.GetNames(typeof(IFPIO.ObjectEnum)));
}
示例4: DataValues
public DataValues(Meta meta, string iEntName, Map map, int iOffsetInChunk, IFPIO.ObjectEnum type, int iLineNumber)
{
this.meta = meta;
this.LineNumber = iLineNumber;
this.chunkOffset = iOffsetInChunk;
this.map = map;
this.EntName = iEntName;
InitializeComponent();
this.Dock = DockStyle.Top;
this.Controls[0].Text = EntName;
this.Controls[2].Text = type.ToString();
this.ValueType = type;
switch (this.ValueType)
{
case IFPIO.ObjectEnum.Byte:
this.size = 1;
break;
case IFPIO.ObjectEnum.Short:
case IFPIO.ObjectEnum.UShort:
this.size = 2;
break;
case IFPIO.ObjectEnum.Int:
case IFPIO.ObjectEnum.UInt:
case IFPIO.ObjectEnum.Float:
case IFPIO.ObjectEnum.Unknown:
this.size = 4;
break;
case IFPIO.ObjectEnum.Unused:
this.size = 0;
break;
}
this.AutoSize = false;
}
示例5: Sky
/// <summary>
/// Initializes a new instance of the <see cref="Sky"/> class.
/// </summary>
/// <param name="tag">The tag.</param>
/// <param name="map">The map.</param>
/// <remarks></remarks>
public Sky(int tag, Map map)
{
map.BR.BaseStream.Position = map.MetaInfo.Offset[tag] + 72;
int tempc = map.BR.ReadInt32();
int tempr = map.BR.ReadInt32() - map.SecondaryMagic;
if (tempc != 0)
{
fogenabled = true;
map.BR.BaseStream.Position = tempr;
fog.R = map.BR.ReadSingle();
fog.G = map.BR.ReadSingle();
fog.B = map.BR.ReadSingle();
fog.A = map.BR.ReadSingle();
fog.Start = map.BR.ReadSingle();
fog.End = map.BR.ReadSingle();
}
map.BR.BaseStream.Position = map.MetaInfo.Offset[tag] + 96;
tempc = map.BR.ReadInt32();
tempr = map.BR.ReadInt32() - map.SecondaryMagic;
if (tempc != 0)
{
map.BR.BaseStream.Position = tempr + 24;
fog.FogThickness = map.BR.ReadSingle();
fog.FogVisibility = map.BR.ReadSingle();
}
}
示例6: Enums
public Enums(Meta meta, string iEntName, Map map, int iOffsetInChunk, int iType, object[] ioptions, int iLineNumber)
{
this.meta = meta;
this.LineNumber = iLineNumber;
this.Options = ioptions;
this.enumType = iType;
this.size = iType / 8;
this.chunkOffset = iOffsetInChunk;
this.map = map;
this.EntName = iEntName;
InitializeComponent();
this.Size = this.PreferredSize;
this.Dock = DockStyle.Top;
this.Controls[0].Text = EntName;
switch (iType)
{
case 8:
{
this.Controls[2].Text = "Enum8";
break;
}
case 16:
{
this.Controls[2].Text = "Enum16";
break;
}
case 32:
{
this.Controls[2].Text = "Enum32";
break;
}
}
this.AutoSize = false;
}
示例7: MetaEditorControlPage
public MetaEditorControlPage(Meta meta, MapForms.MapForm mapForm)
{
InitializeComponent();
// Try to draw treeview nodes to "hide" "disabled" nodes; fail. Still leaves space where node is
//treeViewTagReflexives.DrawMode = TreeViewDrawMode.OwnerDrawAll;
//treeViewTagReflexives.DrawNode += new DrawTreeNodeEventHandler(myTreeView_DrawNode);
this.MapForm = mapForm;
this.map = mapForm.map;
this.meta = meta;
this.BR = new BinaryReader(meta.MS);
// Create a backup of the Tags memory stream, for restoring, comparing, etc
msBackup = new MemoryStream(meta.MS.ToArray());
msDebug = new MemoryStream((int)meta.MS.Length);
mainReflexive = createReflexiveList(); // Done
refreshTreeListing(mainReflexive); // Done
this.treeViewTagReflexives.Sort();
treeViewTagReflexives.SelectedNode = treeViewTagReflexives.Nodes[0];
// Default Peek/Poke to "Single Value"
this.tscbApplyTo.SelectedIndex = 0;
}
示例8: H1BSPConvert
/// <summary>
/// Initializes a new instance of the <see cref="BSPConvert"/> class.
/// </summary>
/// <param name="map">The map.</param>
/// <param name="test">The test.</param>
/// <remarks></remarks>
public H1BSPConvert(Map map, ref PropertyGrid test)
{
switch (map.HaloVersion)
{
case HaloVersionEnum.Halo1:
case HaloVersionEnum.HaloCE:
map.OpenMap(MapTypes.Internal);
H1SBSP h1bsp = new H1SBSP(map.BSP.sbsp[0].TagIndex, map);
test.SelectedObject = h1bsp.Header;
map.CloseMap();
break;
case HaloVersionEnum.Halo2:
case HaloVersionEnum.Halo2Vista:
MessageBox.Show("Open an H1 Map first");
break;
}
// OpenFileDialog open = new OpenFileDialog();
// open.Filter = "*.map|*.map";
// if (open.ShowDialog() == DialogResult.Cancel) return;
// int h2map=Maps.Add(open.FileName);
// Halo2BSP h2bsp = new Halo2BSP(h2map);
// Maps.Remove(h2map);
}
示例9: StringsInfo
/// <summary>
/// Initializes a new instance of the <see cref="StringsInfo"/> class.
/// </summary>
/// <param name="BR">The BR.</param>
/// <param name="map">The map.</param>
/// <remarks></remarks>
public StringsInfo(ref BinaryReader BR, Map map)
{
Name = new string[map.MapHeader.scriptReferenceCount];
Length = new int[map.MapHeader.scriptReferenceCount];
Offset = new int[map.MapHeader.scriptReferenceCount];
// Reads In Offsets Of Meta Names
BR.BaseStream.Position = map.MapHeader.offsetToStringIndex;
for (int x = 0; x < map.MapHeader.scriptReferenceCount; x++)
{
Offset[x] = BR.ReadInt32();
}
for (int x = 0; x < map.MapHeader.scriptReferenceCount; x++)
{
// figures out length of string
int len;
if (x != map.MapHeader.scriptReferenceCount - 1)
{
len = Offset[x + 1] - Offset[x];
}
else
{
len = map.MapHeader.sizeOfScriptReference - Offset[x];
}
Length[x] = len - 1;
/// Reads in string
BR.BaseStream.Position = map.MapHeader.offsetToStringNames2 + Offset[x];
Name[x] = new string(BR.ReadChars(len - 1));
}
}
示例10: HaloLight
/// <summary>
/// Initializes a new instance of the <see cref="HaloLight"/> class.
/// </summary>
/// <param name="tagIndex">Index of the tag.</param>
/// <param name="map">The map.</param>
/// <remarks></remarks>
public HaloLight(int tagIndex, Map map)
{
map.BR.BaseStream.Position = map.MetaInfo.Offset[tagIndex] + 72;
range = map.BR.ReadInt32();
r = (int)(map.BR.ReadSingle() * 255);
g = (int)(map.BR.ReadSingle() * 255);
b = (int)(map.BR.ReadSingle() * 255);
}
示例11: MetaEditor
/// <summary>
/// Initializes a new instance of the <see cref="MetaEditor"/> class.
/// </summary>
/// <param name="ifp">The ifp.</param>
/// <param name="split">The split.</param>
/// <param name="mapx">The mapx.</param>
/// <remarks></remarks>
public MetaEditor(IFPIO ifp, SplitContainer split, Map mapx)
{
map = mapx;
ReflexiveContainer tempr = new ReflexiveContainer("Header");
MakeControls(0, ifp.items, ref tempr);
Controls = tempr;
DrawControls(ref split);
}
示例12: SpawnLoads
/// <summary>
/// Initializes a new instance of the <see cref="SpawnLoads"/> class.
/// </summary>
/// <param name="map">The map.</param>
/// <param name="bsp">The BSP.</param>
/// <param name="device">The device.</param>
/// <remarks></remarks>
public SpawnLoads(Map map, BSPModel bsp, Device device)
{
this.map = map;
this.bsp = bsp;
this.device = device;
SpawnModel = new List<ParsedModel>();
spawnmodelindex = new int[bsp.Spawns.Spawn.Count];
BoundingBoxModel = new Mesh[bsp.Spawns.Spawn.Count];
}
示例13: BuildMeta
/// <summary>
/// The build meta.
/// </summary>
/// <param name="metasplit">The metasplit.</param>
/// <param name="map">The map.</param>
/// <returns></returns>
/// <remarks></remarks>
public static Meta BuildMeta(MetaSplitter metasplit, Map map)
{
metasize = 0;
MetaStream = new MemoryStream(metasplit.Header.chunksize);
BinaryWriter BW = new BinaryWriter(MetaStream);
// BW.BaseStream.Position = 0;
// BW.Write(metasplit.Header.MS.ToArray(), 0, metasplit.Header.chunksize);
metasize += metasplit.Header.chunksize;
TagIndex = metasplit.TagIndex;
Meta m = new Meta(map);
List<Meta.Item> NewItems = new List<Meta.Item>();
// Major error here! Size is not calculated right!
RecursivelyAddPiecesToMeta(metasplit.Header, ref NewItems, ref BW);
m.items = NewItems;
if (MetaStream.Length % 4 != 0)
{
metasize += (int)MetaStream.Length % 4;
MetaStream.SetLength(MetaStream.Length + MetaStream.Length % 4);
}
m.MS = MetaStream;
m.size = metasize;
m.type = metasplit.type;
m.name = metasplit.name;
m.rawType = metasplit.rawtype;
m.raw = metasplit.raw;
m.magic = metasplit.magic;
m.offset = metasplit.offset;
m.TagIndex = TagIndex;
m.RelinkReferences();
m.WriteReferences();
// m.items.Clear();
// MetaScanner Ms = new MetaScanner();
if (m.rawType != RawDataContainerType.Empty)
{
map.OpenMap(MapTypes.Internal);
m.raw = map.Functions.ForMeta.ReadRaw(m.TagIndex, false);
map.CloseMap();
}
// map.OpenMap(MapTypes.Internal);
// IFPIO ifp=IFP.IFPHashMap.GetIfp(m.type);
// m.parsed = true;
// Ms.ScanWithIFP(ref ifp, ref m, map) ;
// map.CloseMap();
return m;
}
示例14: Float
/// <summary>
/// Initializes a new instance of the <see cref="Float"/> class.
/// </summary>
/// <param name="iEntName">
/// The i ent name.
/// </param>
/// <param name="map">
/// The map.
/// </param>
/// <param name="iOffsetInChunk">
/// The i offset in chunk.
/// </param>
public Float(string iEntName, Map map, int iOffsetInChunk)
{
this.chunkOffset = iOffsetInChunk;
this.map = map;
this.EntName = iEntName;
InitializeComponent();
this.Size = this.PreferredSize;
this.Dock = DockStyle.Top;
this.Controls[0].Text = EntName;
this.AutoSize = false;
}
示例15: StringBox
public StringBox(Meta meta, string iEntName, Map map, int iOffsetInChunk, int iLineNumber, int chunkCount)
{
this.meta = meta;
this.LineNumber = iLineNumber;
this.chunkOffset = iOffsetInChunk;
this.map = map;
this.EntName = iEntName;
this.size = chunkCount;
InitializeComponent();
this.Size = this.PreferredSize;
this.Dock = DockStyle.Top;
this.label3.Text = EntName;
this.AutoSize = false;
}