Example #1
0
 public void SetMapCell(int map, int mapColumn, int mapRow, MapCell value)
 {
     if (GetMapColumn(map, mapColumn) == null)
     {
         SetMapColumn(map, mapColumn, new MapColumn());
     }
     this[map][mapColumn][mapRow] = value;
 }
Example #2
0
 public MapCell GetMapCell(int map, int mapColumn, int mapRow, bool autoCreate = false)
 {
     var result = GetMapColumn(map, mapColumn) == null ? null : this[map][mapColumn][mapRow];
     if (result == null && autoCreate)
     {
         result = new MapCell();
         SetMapCell(map, mapColumn, mapRow, result);
     }
     return result;
 }
 internal void OnEnter(MapCell mapCell)
 {
     var creature = Game?.Configuration?.GetCreature(DescriptorIdentifier);
     RunScript(Scripts.OnEnter, this, creature, null, null, mapCell);
 }
Example #4
0
 public abstract object RunScript(string scriptName, InstanceBase self, Descriptor selfDescriptor, InstanceBase other, Descriptor otherDescriptor, MapCell where);
Example #5
0
 public override object RunScript(string scriptName, InstanceBase self, Descriptor selfDescriptor, InstanceBase other, Descriptor otherDescriptor, MapCell where)
 {
     return Configuration?.Game?.RunScript(GetScript(scriptName), self, selfDescriptor, other, otherDescriptor, where);
 }
 internal bool CanEnter(MapCell mapCell)
 {
     return (bool)this.RunOptionalScript(Scripts.CanEnter, this, Descriptor, null, null, mapCell, true);
 }
Example #7
0
 public MapCell GetMapCell(int mapRow, bool autoCreate = false)
 {
     var result = this[mapRow];
     if (result == null && autoCreate)
     {
         result = new MapCell();
         SetMapCell(mapRow, result);
     }
     return result;
 }
Example #8
0
 public void SetMapCell(int mapRow, MapCell value)
 {
     this[mapRow] = value;
 }
Example #9
0
 private object DefaultAction(InstanceBase selfInstance, Descriptor selfDescriptor, InstanceBase otherInstance, Descriptor otherDescriptor, MapCell where)
 {
     throw new NotImplementedException();
 }
Example #10
0
 public void SetMapCell(int atlas,int atlasColumn,int atlasRow,int map,int mapColumn,int mapRow, MapCell value)
 {
     if (GetMapColumn(atlas, atlasColumn, atlasRow, map, mapColumn) == null)
     {
         SetMapColumn(atlas, atlasColumn, atlasRow, map, mapColumn, new MapColumn());
     }
     this[atlas][atlasColumn][atlasRow][map][mapColumn][mapRow] = value;
 }
Example #11
0
 public object RunScript(string scriptName, InstanceBase self, Descriptor selfDescriptor, InstanceBase other, Descriptor otherDescriptor, MapCell where)
 {
     if(ScriptTable!= null)
     {
         return ScriptTable[scriptName](self, selfDescriptor, other, otherDescriptor, where);
     }
     return null;
 }