Example #1
0
 public LOSMap(MapContext<RolePlayActor> map, bool throughEntities = false)
 {
     _losMap = null;
     _mapRP = map;
     _pivotCell = null;
     _throughEntities = throughEntities;
 }
Example #2
0
        public void EmptyKeyValues()
        {
            MapContext<string, int> context = new MapContext<string, int>();

            Assert.IsNotNull(context.KeyValues);
            Assert.AreEqual(0, context.KeyValues.Keys.Count);
        }
Example #3
0
 public LOSMap(MapContext<Fighter> map, bool throughEntities = false)
 {
     _losMap = null;
     _mapF = map;
     _pivotCell = null;
     _throughEntities = throughEntities;
 }
Example #4
0
        public void EmitSaveKeyValues()
        {
            MapContext<string, int> context = new MapContext<string, int>();

            context.Emit("a", 1);
            context.Emit("word", 1);
            context.Emit("is", 1);
            context.Emit("a", 1);
            context.Emit("word", 1);

            Assert.IsNotNull(context.KeyValues);
            Assert.AreEqual(3, context.KeyValues.Keys.Count);

            Assert.IsTrue(context.KeyValues.ContainsKey("word"));
            Assert.IsNotNull(context.KeyValues["word"]);
            Assert.AreEqual(2, context.KeyValues["word"].Count);
            Assert.AreEqual(1, context.KeyValues["word"][0]);
            Assert.AreEqual(1, context.KeyValues["word"][1]);

            Assert.IsTrue(context.KeyValues.ContainsKey("a"));
            Assert.IsNotNull(context.KeyValues["a"]);
            Assert.AreEqual(2, context.KeyValues["a"].Count);
            Assert.AreEqual(1, context.KeyValues["a"][0]);
            Assert.AreEqual(1, context.KeyValues["a"][1]);

            Assert.IsTrue(context.KeyValues.ContainsKey("is"));
            Assert.IsNotNull(context.KeyValues["is"]);
            Assert.AreEqual(1, context.KeyValues["is"].Count);
            Assert.AreEqual(1, context.KeyValues["is"][0]);
        }
Example #5
0
	void Awake() {
		curState = null;
		Menu = new MenuContext( this );
		Character = new CharacterContext( this );
		Map = new MapContext( this );
		EnterName = new EnterNameContext( this );
		MatchScore = new MatchScore( this );
		Header = new HeaderContext( this );
	}
Example #6
0
 private static void Map(int key, string value, MapContext<string, int> context)
 {
     context.Emit(value, 1);
 }
Example #7
0
 public void Map(MapContext context)
 {
     foreach (string word in encoding.GetString(context.InputValue).Split(splitChars, StringSplitOptions.RemoveEmptyEntries))
         context.Emit(encoding.GetBytes(word), encoding.GetBytes("1"));
 }
Example #8
0
 public override Mapper CreateMapper(MapContext context)
 {
     return new WordCountMapper();
 }
Example #9
0
        void IDisposable.Dispose()
        {
            if (_pivotCell != null)
                _pivotCell = null;
            if (_mapRP != null)
                _mapRP = null;
            if (_mapF != null)
                _mapF = null;
            if (_losMap != null)
                _losMap = null;

        }
Example #10
0
 public virtual Reducer CreateCombiner(MapContext context)
 {
     return null;
 }
Example #11
0
 public virtual RecordReader CreateRecordReader(MapContext context)
 {
     return null;
 }
Example #12
0
 public virtual Partitioner CreatePartitioner(MapContext context)
 {
     return null;
 }
Example #13
0
 public abstract Mapper CreateMapper(MapContext context);
Example #14
0
 public void Draw(MapContext context)
 {
     h = EditorGUILayout.Slider(h, context.min_h, context.max_h);
     greater_than = EditorGUILayout.Toggle("Greater than", greater_than);
 }
Example #15
0
 public void Draw(MapContext context)
 {
 }