Ejemplo n.º 1
0
 public KnyttTrigger(KnyttPoint trigger_pos, SwitchID id)
 {
     Pos            = trigger_pos;
     ID             = id;
     AbsoluteTarget = true;
     prefix         = "Trig";
 }
Ejemplo n.º 2
0
 public KnyttArea(KnyttPoint position, KnyttWorld world)
 {
     Warp          = new KnyttWarp(this);
     this.World    = world;
     this.Empty    = true;
     this.Position = position;
     this.fetchAreaExtraData();
     this.fetchFlagWarpData();
 }
Ejemplo n.º 3
0
 protected override void loadFromINI(KeyDataCollection data)
 {
     base.loadFromINI(data);
     FormattedPosition = new KnyttPoint(getIntINIValue(data, "SpawnX"), getIntINIValue(data, "SpawnY"));
     ObjectID          = new KnyttPoint(getIntINIValue(data, "Bank"), getIntINIValue(data, "Object"));
     EffectOffset      = new KnyttPoint(getIntINIValue(data, "EffectX"), getIntINIValue(data, "EffectY"));
     AsOne             = getBoolINIValue(data, "AsOne", true);
     Repeat            = getBoolINIValue(data, "Repeat", false);
 }
Ejemplo n.º 4
0
 public KnyttShift(KnyttPoint area_pos, KnyttPoint shift_pos, SwitchID id)
 {
     AreaPos        = area_pos;
     Pos            = shift_pos;
     ID             = id;
     AbsoluteTarget = false; // Relative by default
     AsOne          = true;
     Repeat         = true;
     prefix         = "Shift";
 }
Ejemplo n.º 5
0
 protected override void loadFromINI(KeyDataCollection data)
 {
     base.loadFromINI(data);
     FormattedArea     = new KnyttPoint(getIntINIValue(data, "XMap"), getIntINIValue(data, "YMap"));
     FormattedPosition = new KnyttPoint(getIntINIValue(data, "XPos"), getIntINIValue(data, "YPos"));
     Save      = getBoolINIValue(data, "Save", false);
     StopMusic = getBoolINIValue(data, "StopMusic", true);
     Quantize  = getBoolINIValue(data, "Quantize", true);
     StopMusic = getBoolINIValue(data, "StopMusic", false);
     Cutscene  = getStringINIValue(data, "Cutscene");
     FlagOn    = JuniValues.Flag.Parse(getStringINIValue(data, "FlagOn"));
     FlagOff   = JuniValues.Flag.Parse(getStringINIValue(data, "FlagOff"));
     Coin      = getIntINIValue(data, "Coin");
     Delay     = getIntINIValue(data, "Time");
 }
Ejemplo n.º 6
0
 public KnyttPoint getWarpCoords(KnyttPoint new_area, KnyttPoint current_area)
 {
     if (new_area.x < current_area.x)
     {
         return(WarpLeft);
     }
     if (new_area.x > current_area.x)
     {
         return(WarpRight);
     }
     if (new_area.y > current_area.y)
     {
         return(WarpDown);
     }
     if (new_area.y < current_area.y)
     {
         return(WarpUp);
     }
     throw (new SystemException("Invalid warp!"));
 }
Ejemplo n.º 7
0
 public KnyttTrigger(KnyttArea area, KnyttPoint shift_pos, SwitchID id) : this(shift_pos, id, area.ExtraData)
 {
 }
Ejemplo n.º 8
0
 public KnyttTrigger(KnyttPoint trigger_pos, SwitchID id, KeyDataCollection data) : this(trigger_pos, id)
 {
     loadFromINI(data);
 }
Ejemplo n.º 9
0
 public KnyttShift(KnyttArea area, KnyttPoint shift_pos, SwitchID id) : this(area.Position, shift_pos, id, area.ExtraData)
 {
 }
Ejemplo n.º 10
0
 public KnyttShift(KnyttPoint area_pos, KnyttPoint shift_pos, SwitchID id, KeyDataCollection data) : this(area_pos, shift_pos, id)
 {
     loadFromINI(data);
 }
Ejemplo n.º 11
0
 public int manhattanDistance(KnyttPoint point)
 {
     return(Math.Abs(point.x - x) + Math.Abs(point.y - y));
 }
Ejemplo n.º 12
0
 public KnyttPoint max(KnyttPoint point)
 {
     return(new KnyttPoint(Math.Max(point.x, x), Math.Max(point.y, y)));
 }
Ejemplo n.º 13
0
 public void setAreaPosition(KnyttPoint location)
 {
     data["Positions"]["X Pos"] = location.x.ToString();
     data["Positions"]["Y Pos"] = location.y.ToString();
 }
Ejemplo n.º 14
0
 public int getMapIndex(KnyttPoint coords)
 {
     return((coords.y - MinBounds.y) * Size.x + (coords.x - MinBounds.x));
 }
Ejemplo n.º 15
0
        // TODO: This logic needs refactoring when things are fleshed out
        public KnyttArea getArea(KnyttPoint coords)
        {
            bool out_of_bounds = coords.x <MinBounds.x || coords.x> MaxBounds.x || coords.y <MinBounds.y || coords.y> MaxBounds.y;

            return(out_of_bounds ? null : this.Map[getMapIndex(coords)]);
        }