Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Commit

Permalink
Hajó osztály
Browse files Browse the repository at this point in the history
  • Loading branch information
mihalypal committed Apr 23, 2022
1 parent 5b633cb commit a9d00c6
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion MihalyPal_HorvathKrisztian/Torpedo/Beadando/Hajo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,45 @@ namespace Beadando
{
internal class Hajo
{
public int X { get; set; }

This comment has been minimized.

Copy link
@webmaster442

webmaster442 Apr 23, 2022

Contributor

Mivel van paraméteres konstruktora az osztálynak, ezért a set; tag elhagyható

public int Y { get; set; }

private int Tipus;
public int Eletero { get; set; }

public Hajo(int x, int y, int tipus, int eletero)
{
X = x;
Y = y;
Tipus = tipus;
Eletero = eletero;

}
public Hajo()
{

}
public void SetTipus(int tipus)
{
if (tipus >= 2 && tipus <= 5)

This comment has been minimized.

{
this.Tipus = tipus;
}
}
public int GetTipus() { return this.Tipus; }
public Boolean HajoKoordinataE(int x, int y)
{
if (x == X && y == Y)

This comment has been minimized.

Copy link
@webmaster442

webmaster442 Apr 23, 2022

Contributor

return x == X && y == Y ugyan azt fogja csinálni és nem redundáns

{
return true;
}
else
{
return false;
}
}
//Attributumai egy x és y kezdőérték
//tipusa: 2,3,4,5
//életerő: ami kezdetben a típussal egyezik meg de ez csökken
}
}
}

0 comments on commit a9d00c6

Please sign in to comment.