Пример #1
0
 internal override VisibleObject Copy(VisibleObject parent)
 {
     return this;
 }
Пример #2
0
 internal override bool Intersection(VisibleObject obj)
 {
     if (obj is Entity) {
         Entity _obj = (Entity)obj;
         return (this._cell == _obj._cell);
     }
     else
     {
         return false;
     }
 }
Пример #3
0
 internal override void Remove(VisibleObject obj)
 {
 }
Пример #4
0
 internal override VisibleObject Copy(VisibleObject parent)
 {
     return(this);
 }
Пример #5
0
 internal override void Remove(VisibleObject obj)
 {
 }
Пример #6
0
 internal abstract bool Intersection(VisibleObject obj);
Пример #7
0
 internal override VisibleObject Copy(VisibleObject parent)
 {
     return new Submarine(Cell, (Team)parent, Texture, Number, Health, TorpedoCount, MinesCount);
 }
Пример #8
0
 internal override bool Intersection(VisibleObject obj)
 {
     return(false);
 }
Пример #9
0
 internal override VisibleObject Copy(VisibleObject parent)
 {
     Mine mine = new Mine(Cell, (Team)parent);
     mine.activate();
     return mine;
 }
Пример #10
0
 internal override VisibleObject Copy(VisibleObject parent)
 {
     return(new Submarine(Cell, (Team)parent, Texture, Number, Health, TorpedoCount, MinesCount));
 }
Пример #11
0
 internal virtual void addToCollection(VisibleObject obj)
 {
     collection.Add(obj);
 }
Пример #12
0
 internal override VisibleObject Copy(VisibleObject parent)
 {
     Team newTeam = new Team(TeamId, AI, Field);
     newTeam.InitForReplay((EntityCollection)parent);
     foreach (VisibleObject obj in Collection)
         newTeam.addToCollection(obj.Copy(newTeam));
     return newTeam;
 }
Пример #13
0
 internal override void Remove(VisibleObject obj)
 {
     if (Collection.Contains(obj))
     {
         if (obj is Submarine)
         {
             Submarine sub = obj as Submarine;
             ((EntityCollection)Parent).addToCollection(new SunkSubmarine(sub.Cell, this.Color));
         }
         Collection.Remove(obj);
     }
 }
Пример #14
0
 internal abstract void Remove(VisibleObject obj);
Пример #15
0
 internal override VisibleObject Copy(VisibleObject parent)
 {
     return new SunkSubmarine(Cell, color);
 }
Пример #16
0
 internal override VisibleObject Copy(VisibleObject parent)
 {
     return(new SunkSubmarine(Cell, color));
 }
Пример #17
0
 internal void saveMarker(VisibleObject vo)
 {
     sw.WriteLine("Marker");
     if (vo is Aim)
         sw.WriteLine("Aim");
     if (vo is Circle)
         sw.WriteLine("Circle");
     if (vo is Check)
         sw.WriteLine("Check");
     if (vo is Flag)
         sw.WriteLine("Flag");
     if (vo is XMark)
         sw.WriteLine("XMark");
     Marker marker = vo as Marker;
     sw.WriteLine(marker.Cell.I + " " + marker.Cell.J);
     sw.WriteLine("End marker");
     sw.Flush();
 }
Пример #18
0
 internal abstract VisibleObject Copy(VisibleObject parent);