Empeld
Empeld plugin documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
essentials.Systems.Structures.Network.BlockTypeGroup Struct Reference

Group of blocks used in structure networks More...

Inheritance diagram for essentials.Systems.Structures.Network.BlockTypeGroup:

Public Member Functions

 BlockTypeGroup (ushort[] ids)
 
 BlockTypeGroup (IEnumerable< ushort > ids)
 
 BlockTypeGroup (IEnumerable< IBlock > blocks)
 
bool Contains (ushort id)
 
bool Equals (BlockTypeGroup typeGroup)
 
override bool Equals (object obj)
 
override int GetHashCode ()
 
override string ToString ()
 

Public Attributes

readonly ushort[] BlockTypeIds
 

Detailed Description

Group of blocks used in structure networks

Constructor & Destructor Documentation

essentials.Systems.Structures.Network.BlockTypeGroup.BlockTypeGroup ( ushort[]  ids)
16  {
17  this.BlockTypeIds = ids;
18  }
readonly ushort[] BlockTypeIds
Definition: BlockTypeGroup.cs:13
essentials.Systems.Structures.Network.BlockTypeGroup.BlockTypeGroup ( IEnumerable< ushort >  ids)
21  :this(ids.ToArray())
22  { }
essentials.Systems.Structures.Network.BlockTypeGroup.BlockTypeGroup ( IEnumerable< IBlock blocks)
25  :this(blocks.Select(x => x.Id).ToArray())
26  { }

Member Function Documentation

bool essentials.Systems.Structures.Network.BlockTypeGroup.Contains ( ushort  id)

Attribute: i

== id)

29  {
30  for (int i=0; i<this.BlockTypeIds.Length; ++i)
31  {
32  if (this.BlockTypeIds [i] == id)
33  return true;
34  }
35  return false;
36  }
readonly ushort[] BlockTypeIds
Definition: BlockTypeGroup.cs:13
bool essentials.Systems.Structures.Network.BlockTypeGroup.Equals ( BlockTypeGroup  typeGroup)
39  {
40  return Enumerable.SequenceEqual(this.BlockTypeIds, typeGroup.BlockTypeIds);
41  }
readonly ushort[] BlockTypeIds
Definition: BlockTypeGroup.cs:13
override bool essentials.Systems.Structures.Network.BlockTypeGroup.Equals ( object  obj)
44  {
45  if (obj is BlockTypeGroup)
46  {
47  return this.Equals((BlockTypeGroup)obj);
48  }
49  return false;
50  }
bool Equals(BlockTypeGroup typeGroup)
Definition: BlockTypeGroup.cs:38
BlockTypeGroup(ushort[] ids)
Definition: BlockTypeGroup.cs:15
override int essentials.Systems.Structures.Network.BlockTypeGroup.GetHashCode ( )

Attribute: i

;

53  {
54  int hash = 0;
55  int i = this.BlockTypeIds.Length - 1;
56  while (i >= 0)
57  {
58  hash ^= this.BlockTypeIds[i];
59  --i;
60  }
61  return hash;
62  }
readonly ushort[] BlockTypeIds
Definition: BlockTypeGroup.cs:13
override string essentials.Systems.Structures.Network.BlockTypeGroup.ToString ( )
65  {
66  return string.Format("BlockGroup ({0})", string.Join(",", this.BlockTypeIds));
67  }
readonly ushort[] BlockTypeIds
Definition: BlockTypeGroup.cs:13

Member Data Documentation

readonly ushort [] essentials.Systems.Structures.Network.BlockTypeGroup.BlockTypeIds

The documentation for this struct was generated from the following file: