SlideShare a Scribd company logo
CS 3 Project (Inheritance, Access Modifiers, Interface)

Starcraft II ( sorry girls, next time na kayo :D )
Instructions

        Create the following classes in two separate packages (Buildings and Units)
        Use the proper inheritance and interfaces to make coding easier.
        Create Abstract Classes and Interfaces as needed
        Create additional function and variables as needed
        Try to apply the necessary access modifiers for the functions and attributes/variables
        Point distribution: 10 points per class + 30 pts worth of bonuses (180/150).

List of Buildings                                      List of Units
      Command Center                                        Infantry
      Barracks                                                      o SCV
      Factory                                                       o Marine
      Starport                                                      o Marauder
                                                                     o Ghost
                                                             Vehicles
                                                                     o Hellion
                                                                     o Siege Tank
                                                                     o Thor
                                                             Ships
                                                                     o Medivac
                                                                     o Viking
                                                                     o Banshee
                                                                     o Battlecruiser



Basic Attributes and Functions

        All buildings and units have an attribute hp and maxhp. Both ints. Hp is initially equal to maxhp.
        All buildings and units have a String attribute, status. That is “Normal” at first but changes
         depending on what happens to them.
        All building and units have two attributes (double) for their x and y coordinates.
        All buildings and units have a function takeDamage(int damage) that decreases their hp by
         damage.
        If a buildings hp is lower than 10% of its maxhp, its status is “Burning”.
        All units have a move function (x and y parameters) that set their x and y coordinates to new
         ones.
        Ships have the function fly which is the same as move.
        Only specific units can attack units that can fly.
Infantry Units

      All infantry units have an attribute range(double)
      All infantry units have a function attack(Target) which deals damage to Target as long as the
       distance between the unit and the Target is less than or equal to the range. Target is either a
       building or unit.
      If a unit’s hp is 0 or less, its status is “Dead” and cannot attack anymore.
      SCV
            o Range is 1
            o Damage is 5
            o Maxhp is 45
            o Has function buildCommandCenter which returns a CommandCenter object
            o Has function buildBarracks which returns a Barracks object
            o Has function build Factory which returns a Factory object
            o Has function buildStarport which returns a Starport object
            o Cannot attack flying units
      Marines
            o Range is 5
            o Attack deals 6 damage
            o Maxhp is 45
            o Can attack any other unit or building
      Marauder
            o Range is 6
            o Attack deals 10 damage
            o Maxhp is 125
            o Cannot attack units that fly
            o Target’s status is changed to “Slow”
      Ghost
            o Range is 6
            o Maxhp is 100
            o Ghosts have an attribute SP which is default to 200
            o Attack deals 10 damage
            o Has an function snipe(Target)
                      Target must be an Infantry Unit
                      Snipe deals 45 damage to Target
                      Range is 10
            o Has function cloak
                      If SP is greater than or equal to 25, sets status to “Invisible”
                      Decreases SP by 25
                      If a ghost is invisible, it does not take damage
Vehicle Units

      All vehicles have an attribute range(double)
      All vehicles have a function attack(Target) which deals damage to Target as long as the distance
       between the unit and the Target is less than or equal to the range. Target is either a building or
       unit.
      If a vehicle’s hp is 0 or less, its status is “Dead” and cannot attack anymore.
      Hellion
            o Range is 5
            o Attack deals 8 damage
            o Maxhp is 90
            o Hellions cannot attack flying units
      Siege Tank
            o Range is 7
            o Attack deals 15 damage
            o Maxhp is 160
            o Siege Tanks cannot attack flying units
            o Siege Tanks have a siegeMode function
                      Status is set to “Siege”
                      Range is now 13 and damage from attacks is now 35
                      However you cannot attack targets that are within 2 distance
            o Siege Tanks also have a function normalMode where status is back to “Normal”, range
                and damage are also returned to normal
      Thor
            o Range is 7
            o Attack damage is 30
            o Maxhp is 400
Ship Units

      All ships units are flying
      Not all ships can attack
      If a ship’s hp is 0 or less, its status is “Dead” and cannot attack anymore.
      Viking
            o Range is 9
            o Attack deals 12 damage
            o Maxhp is 120
            o Can only attack flying units
      Medivac
            o Cannot attack units
            o Maxhp is 150
            o Has an attribute, cargo which is an array of units (size 6)
            o Has a load(unit) function which adds the unit to the array
            o Has unload(int) function which returns the unit at the int index of the array
            o If the Medivac moves, the units in cargo moves with it
            o Meduvacs have an attribute SP initially at 200
            o Medivac can also heal(Target)
                      Increases Target’s hp by 3, not exceeding the maxhp as long as SP is greater
                          than 0.
                      Decreases hp by 1.
      Banshee
            o Range is 6
            o Attack deals 12 damage
            o Maxhp is 140
            o Has an attribute SP, similar to ghosts
            o Cannot attack other ships
            o Can cloak, similar to ghosts
      Battlecruiser
            o Range is 6
            o Attack deals 8 damage
            o Maxhp is 550
            o Has an attribute SP which is initially 250
            o Has a function weaponRefit(Target)
                      Deals 300 damage to the target as long as SP is greater than or equal to 125
                      Decreases SP by 125
                      Range is 10
Buildings

      CommandCenter
           o Maxhp is 1500
           o Has function trainSCV, which returns an SCV object
      Barracks
           o Maxhp is 1000
           o Has functions:
                  trainMarine, which returns a Marine object
                  trainMarauder, which returns a Marauder object
                  trainGhost, which returns a Ghost object
      Factory
           o Maxhp is 1250
           o Has functions:
                  trainHellion, which returns a Hellion object
                  trainSiegeTank, which returns a SiegeTank object
                  trainThor, which returns a Thor object
      Starport
           o Maxhp is 1300
           o Has functions:
                  trainViking, which returns a Viking object
                  trainMedivac, which returns a Medivac object
                  trainBanshee, which returns a Banshee object
                  trainBattlecruise, which returns a Battlecruiser object

BONUS FUNCTIONS

      Buildings have the ability liftoff (5 pts)
            o Status is set to “Flying”
            o While flying only units that can attack flying units can attack it
      Buildings also have ability to land (5 pts)
            o Status is set to “Normal”
            o While flying only units that can attack ground units can attack it
      Vikings also have the ability to lift-off and land (5 pts)
            o While flying, Vikings can only attack flying units
            o While landed, Vikings can only attack units that are not flying
      Hellions deal 16 damage to Infantry units (5 pts)
      If a Medivac dies, all unit inside it also dies (5 pts)
      Output a message (System.out.println) whenever an attack is successful or not. (5 pts)

More Related Content

Viewers also liked

M4 combinatronics hw
M4   combinatronics hwM4   combinatronics hw
M4 combinatronics hw
iamkim
 
Hypothesis testing
Hypothesis testingHypothesis testing
Hypothesis testing
iamkim
 
Graduation pictorial schedule
Graduation pictorial scheduleGraduation pictorial schedule
Graduation pictorial schedule
iamkim
 
Math reviewer 2
Math reviewer 2Math reviewer 2
Math reviewer 2iamkim
 
Chi square hand out (1)
Chi square hand out (1)Chi square hand out (1)
Chi square hand out (1)
iamkim
 
Str statistics lec notes
Str   statistics lec notesStr   statistics lec notes
Str statistics lec notes
iamkim
 
Physics statics
Physics   staticsPhysics   statics
Physics statics
iamkim
 
14 january 2011 congress
14 january 2011 congress14 january 2011 congress
14 january 2011 congress
iamkim
 
Upcat sched
Upcat   schedUpcat   sched
Upcat sched
iamkim
 
Str tlc
Str   tlcStr   tlc
Str tlc
iamkim
 
Yearbook grad pic orders
Yearbook   grad pic ordersYearbook   grad pic orders
Yearbook grad pic orders
iamkim
 
Dost application
Dost applicationDost application
Dost application
iamkim
 
Fil panitikan
Fil   panitikanFil   panitikan
Fil panitikaniamkim
 
Nat Sci - Minerals
Nat Sci - MineralsNat Sci - Minerals
Nat Sci - Minerals
iamkim
 
Cat revised guidelines on tickler formatting (with signatures).
Cat   revised guidelines on tickler formatting (with signatures).Cat   revised guidelines on tickler formatting (with signatures).
Cat revised guidelines on tickler formatting (with signatures).
iamkim
 
Letter aug 1
Letter aug 1Letter aug 1
Letter aug 1
iamkim
 
Chem anions
Chem   anionsChem   anions
Chem anions
iamkim
 
2012 Batch Congress
2012 Batch Congress2012 Batch Congress
2012 Batch Congress
iamkim
 
Grad ball collections per section(01 28-12)
Grad ball collections per section(01 28-12)Grad ball collections per section(01 28-12)
Grad ball collections per section(01 28-12)
iamkim
 
Physics laser printerppt-pres.
Physics   laser printerppt-pres.Physics   laser printerppt-pres.
Physics laser printerppt-pres.
iamkim
 

Viewers also liked (20)

M4 combinatronics hw
M4   combinatronics hwM4   combinatronics hw
M4 combinatronics hw
 
Hypothesis testing
Hypothesis testingHypothesis testing
Hypothesis testing
 
Graduation pictorial schedule
Graduation pictorial scheduleGraduation pictorial schedule
Graduation pictorial schedule
 
Math reviewer 2
Math reviewer 2Math reviewer 2
Math reviewer 2
 
Chi square hand out (1)
Chi square hand out (1)Chi square hand out (1)
Chi square hand out (1)
 
Str statistics lec notes
Str   statistics lec notesStr   statistics lec notes
Str statistics lec notes
 
Physics statics
Physics   staticsPhysics   statics
Physics statics
 
14 january 2011 congress
14 january 2011 congress14 january 2011 congress
14 january 2011 congress
 
Upcat sched
Upcat   schedUpcat   sched
Upcat sched
 
Str tlc
Str   tlcStr   tlc
Str tlc
 
Yearbook grad pic orders
Yearbook   grad pic ordersYearbook   grad pic orders
Yearbook grad pic orders
 
Dost application
Dost applicationDost application
Dost application
 
Fil panitikan
Fil   panitikanFil   panitikan
Fil panitikan
 
Nat Sci - Minerals
Nat Sci - MineralsNat Sci - Minerals
Nat Sci - Minerals
 
Cat revised guidelines on tickler formatting (with signatures).
Cat   revised guidelines on tickler formatting (with signatures).Cat   revised guidelines on tickler formatting (with signatures).
Cat revised guidelines on tickler formatting (with signatures).
 
Letter aug 1
Letter aug 1Letter aug 1
Letter aug 1
 
Chem anions
Chem   anionsChem   anions
Chem anions
 
2012 Batch Congress
2012 Batch Congress2012 Batch Congress
2012 Batch Congress
 
Grad ball collections per section(01 28-12)
Grad ball collections per section(01 28-12)Grad ball collections per section(01 28-12)
Grad ball collections per section(01 28-12)
 
Physics laser printerppt-pres.
Physics   laser printerppt-pres.Physics   laser printerppt-pres.
Physics laser printerppt-pres.
 

More from iamkim

Nat sci minerals part1
Nat sci   minerals part1Nat sci   minerals part1
Nat sci minerals part1
iamkim
 
Batch 2012 schedule of exit interview
Batch 2012 schedule of exit interviewBatch 2012 schedule of exit interview
Batch 2012 schedule of exit interview
iamkim
 
College test results b2012
College test results b2012College test results b2012
College test results b2012
iamkim
 
Chem cations
Chem   cationsChem   cations
Chem cations
iamkim
 
Congratulations to batch 2012 star scholar candidates
Congratulations to batch 2012 star scholar candidatesCongratulations to batch 2012 star scholar candidates
Congratulations to batch 2012 star scholar candidates
iamkim
 
Retreat consent form
Retreat consent formRetreat consent form
Retreat consent formiamkim
 
Retreat agreements
Retreat agreementsRetreat agreements
Retreat agreementsiamkim
 
Fil la loba negra
Fil   la loba negraFil   la loba negra
Fil la loba negraiamkim
 
Fil fray botod
Fil   fray botodFil   fray botod
Fil fray botodiamkim
 
Fil 3 q readings
Fil   3 q readingsFil   3 q readings
Fil 3 q readingsiamkim
 
Dasalan at tocsohan
Dasalan at tocsohanDasalan at tocsohan
Dasalan at tocsohaniamkim
 
Chem ps electrolysis
Chem   ps electrolysisChem   ps electrolysis
Chem ps electrolysis
iamkim
 
Physics waves
Physics   wavesPhysics   waves
Physics waves
iamkim
 
Math 3 hw ps2
Math   3 hw ps2Math   3 hw ps2
Math 3 hw ps2
iamkim
 
Memo circular # 4 dtd nov 4, 2011
Memo circular # 4 dtd nov 4, 2011Memo circular # 4 dtd nov 4, 2011
Memo circular # 4 dtd nov 4, 2011iamkim
 
Final creative shots hair & makeup evaluation (110211)
Final creative shots hair & makeup evaluation (110211)Final creative shots hair & makeup evaluation (110211)
Final creative shots hair & makeup evaluation (110211)iamkim
 
Creative shots hair & makeup evaluation (110211)
Creative shots hair & makeup evaluation (110211)Creative shots hair & makeup evaluation (110211)
Creative shots hair & makeup evaluation (110211)iamkim
 
Cat creative marching guidelines
Cat   creative marching guidelinesCat   creative marching guidelines
Cat creative marching guidelines
iamkim
 
Reminders
RemindersReminders
Reminders
iamkim
 
Ust reminders
Ust remindersUst reminders
Ust reminders
iamkim
 

More from iamkim (20)

Nat sci minerals part1
Nat sci   minerals part1Nat sci   minerals part1
Nat sci minerals part1
 
Batch 2012 schedule of exit interview
Batch 2012 schedule of exit interviewBatch 2012 schedule of exit interview
Batch 2012 schedule of exit interview
 
College test results b2012
College test results b2012College test results b2012
College test results b2012
 
Chem cations
Chem   cationsChem   cations
Chem cations
 
Congratulations to batch 2012 star scholar candidates
Congratulations to batch 2012 star scholar candidatesCongratulations to batch 2012 star scholar candidates
Congratulations to batch 2012 star scholar candidates
 
Retreat consent form
Retreat consent formRetreat consent form
Retreat consent form
 
Retreat agreements
Retreat agreementsRetreat agreements
Retreat agreements
 
Fil la loba negra
Fil   la loba negraFil   la loba negra
Fil la loba negra
 
Fil fray botod
Fil   fray botodFil   fray botod
Fil fray botod
 
Fil 3 q readings
Fil   3 q readingsFil   3 q readings
Fil 3 q readings
 
Dasalan at tocsohan
Dasalan at tocsohanDasalan at tocsohan
Dasalan at tocsohan
 
Chem ps electrolysis
Chem   ps electrolysisChem   ps electrolysis
Chem ps electrolysis
 
Physics waves
Physics   wavesPhysics   waves
Physics waves
 
Math 3 hw ps2
Math   3 hw ps2Math   3 hw ps2
Math 3 hw ps2
 
Memo circular # 4 dtd nov 4, 2011
Memo circular # 4 dtd nov 4, 2011Memo circular # 4 dtd nov 4, 2011
Memo circular # 4 dtd nov 4, 2011
 
Final creative shots hair & makeup evaluation (110211)
Final creative shots hair & makeup evaluation (110211)Final creative shots hair & makeup evaluation (110211)
Final creative shots hair & makeup evaluation (110211)
 
Creative shots hair & makeup evaluation (110211)
Creative shots hair & makeup evaluation (110211)Creative shots hair & makeup evaluation (110211)
Creative shots hair & makeup evaluation (110211)
 
Cat creative marching guidelines
Cat   creative marching guidelinesCat   creative marching guidelines
Cat creative marching guidelines
 
Reminders
RemindersReminders
Reminders
 
Ust reminders
Ust remindersUst reminders
Ust reminders
 

Recently uploaded

2015pmkemenhub163.pdf 2015pmkemenhub163.pdf
2015pmkemenhub163.pdf 2015pmkemenhub163.pdf2015pmkemenhub163.pdf 2015pmkemenhub163.pdf
2015pmkemenhub163.pdf 2015pmkemenhub163.pdf
CIkumparan
 
Gabriel Whitley's Motion Summary Judgment
Gabriel Whitley's Motion Summary JudgmentGabriel Whitley's Motion Summary Judgment
Gabriel Whitley's Motion Summary Judgment
Abdul-Hakim Shabazz
 
Hindustan Insider 2nd edition release now
Hindustan Insider 2nd edition release nowHindustan Insider 2nd edition release now
Hindustan Insider 2nd edition release now
hindustaninsider22
 
EED - The Container Port PERFORMANCE INDEX 2023
EED - The Container Port PERFORMANCE INDEX 2023EED - The Container Port PERFORMANCE INDEX 2023
EED - The Container Port PERFORMANCE INDEX 2023
El Estrecho Digital
 
Letter-from-ECI-to-MeiTY-21st-march-2024.pdf
Letter-from-ECI-to-MeiTY-21st-march-2024.pdfLetter-from-ECI-to-MeiTY-21st-march-2024.pdf
Letter-from-ECI-to-MeiTY-21st-march-2024.pdf
bhavenpr
 
MAGNA CARTA (minimum 40 characters required)
MAGNA CARTA (minimum 40 characters required)MAGNA CARTA (minimum 40 characters required)
MAGNA CARTA (minimum 40 characters required)
Filippo64
 
Acolyte Episodes review (TV series)..pdf
Acolyte Episodes review (TV series)..pdfAcolyte Episodes review (TV series)..pdf
Acolyte Episodes review (TV series)..pdf
46adnanshahzad
 
What Ukraine Has Lost During Russia’s Invasion
What Ukraine Has Lost During Russia’s InvasionWhat Ukraine Has Lost During Russia’s Invasion
What Ukraine Has Lost During Russia’s Invasion
LUMINATIVE MEDIA/PROJECT COUNSEL MEDIA GROUP
 
Essential Tools for Modern PR Business .pptx
Essential Tools for Modern PR Business .pptxEssential Tools for Modern PR Business .pptx
Essential Tools for Modern PR Business .pptx
Pragencyuk
 

Recently uploaded (9)

2015pmkemenhub163.pdf 2015pmkemenhub163.pdf
2015pmkemenhub163.pdf 2015pmkemenhub163.pdf2015pmkemenhub163.pdf 2015pmkemenhub163.pdf
2015pmkemenhub163.pdf 2015pmkemenhub163.pdf
 
Gabriel Whitley's Motion Summary Judgment
Gabriel Whitley's Motion Summary JudgmentGabriel Whitley's Motion Summary Judgment
Gabriel Whitley's Motion Summary Judgment
 
Hindustan Insider 2nd edition release now
Hindustan Insider 2nd edition release nowHindustan Insider 2nd edition release now
Hindustan Insider 2nd edition release now
 
EED - The Container Port PERFORMANCE INDEX 2023
EED - The Container Port PERFORMANCE INDEX 2023EED - The Container Port PERFORMANCE INDEX 2023
EED - The Container Port PERFORMANCE INDEX 2023
 
Letter-from-ECI-to-MeiTY-21st-march-2024.pdf
Letter-from-ECI-to-MeiTY-21st-march-2024.pdfLetter-from-ECI-to-MeiTY-21st-march-2024.pdf
Letter-from-ECI-to-MeiTY-21st-march-2024.pdf
 
MAGNA CARTA (minimum 40 characters required)
MAGNA CARTA (minimum 40 characters required)MAGNA CARTA (minimum 40 characters required)
MAGNA CARTA (minimum 40 characters required)
 
Acolyte Episodes review (TV series)..pdf
Acolyte Episodes review (TV series)..pdfAcolyte Episodes review (TV series)..pdf
Acolyte Episodes review (TV series)..pdf
 
What Ukraine Has Lost During Russia’s Invasion
What Ukraine Has Lost During Russia’s InvasionWhat Ukraine Has Lost During Russia’s Invasion
What Ukraine Has Lost During Russia’s Invasion
 
Essential Tools for Modern PR Business .pptx
Essential Tools for Modern PR Business .pptxEssential Tools for Modern PR Business .pptx
Essential Tools for Modern PR Business .pptx
 

Cs project instructions

  • 1. CS 3 Project (Inheritance, Access Modifiers, Interface) Starcraft II ( sorry girls, next time na kayo :D ) Instructions  Create the following classes in two separate packages (Buildings and Units)  Use the proper inheritance and interfaces to make coding easier.  Create Abstract Classes and Interfaces as needed  Create additional function and variables as needed  Try to apply the necessary access modifiers for the functions and attributes/variables  Point distribution: 10 points per class + 30 pts worth of bonuses (180/150). List of Buildings List of Units  Command Center  Infantry  Barracks o SCV  Factory o Marine  Starport o Marauder o Ghost  Vehicles o Hellion o Siege Tank o Thor  Ships o Medivac o Viking o Banshee o Battlecruiser Basic Attributes and Functions  All buildings and units have an attribute hp and maxhp. Both ints. Hp is initially equal to maxhp.  All buildings and units have a String attribute, status. That is “Normal” at first but changes depending on what happens to them.  All building and units have two attributes (double) for their x and y coordinates.  All buildings and units have a function takeDamage(int damage) that decreases their hp by damage.  If a buildings hp is lower than 10% of its maxhp, its status is “Burning”.  All units have a move function (x and y parameters) that set their x and y coordinates to new ones.  Ships have the function fly which is the same as move.  Only specific units can attack units that can fly.
  • 2. Infantry Units  All infantry units have an attribute range(double)  All infantry units have a function attack(Target) which deals damage to Target as long as the distance between the unit and the Target is less than or equal to the range. Target is either a building or unit.  If a unit’s hp is 0 or less, its status is “Dead” and cannot attack anymore.  SCV o Range is 1 o Damage is 5 o Maxhp is 45 o Has function buildCommandCenter which returns a CommandCenter object o Has function buildBarracks which returns a Barracks object o Has function build Factory which returns a Factory object o Has function buildStarport which returns a Starport object o Cannot attack flying units  Marines o Range is 5 o Attack deals 6 damage o Maxhp is 45 o Can attack any other unit or building  Marauder o Range is 6 o Attack deals 10 damage o Maxhp is 125 o Cannot attack units that fly o Target’s status is changed to “Slow”  Ghost o Range is 6 o Maxhp is 100 o Ghosts have an attribute SP which is default to 200 o Attack deals 10 damage o Has an function snipe(Target)  Target must be an Infantry Unit  Snipe deals 45 damage to Target  Range is 10 o Has function cloak  If SP is greater than or equal to 25, sets status to “Invisible”  Decreases SP by 25  If a ghost is invisible, it does not take damage
  • 3. Vehicle Units  All vehicles have an attribute range(double)  All vehicles have a function attack(Target) which deals damage to Target as long as the distance between the unit and the Target is less than or equal to the range. Target is either a building or unit.  If a vehicle’s hp is 0 or less, its status is “Dead” and cannot attack anymore.  Hellion o Range is 5 o Attack deals 8 damage o Maxhp is 90 o Hellions cannot attack flying units  Siege Tank o Range is 7 o Attack deals 15 damage o Maxhp is 160 o Siege Tanks cannot attack flying units o Siege Tanks have a siegeMode function  Status is set to “Siege”  Range is now 13 and damage from attacks is now 35  However you cannot attack targets that are within 2 distance o Siege Tanks also have a function normalMode where status is back to “Normal”, range and damage are also returned to normal  Thor o Range is 7 o Attack damage is 30 o Maxhp is 400
  • 4. Ship Units  All ships units are flying  Not all ships can attack  If a ship’s hp is 0 or less, its status is “Dead” and cannot attack anymore.  Viking o Range is 9 o Attack deals 12 damage o Maxhp is 120 o Can only attack flying units  Medivac o Cannot attack units o Maxhp is 150 o Has an attribute, cargo which is an array of units (size 6) o Has a load(unit) function which adds the unit to the array o Has unload(int) function which returns the unit at the int index of the array o If the Medivac moves, the units in cargo moves with it o Meduvacs have an attribute SP initially at 200 o Medivac can also heal(Target)  Increases Target’s hp by 3, not exceeding the maxhp as long as SP is greater than 0.  Decreases hp by 1.  Banshee o Range is 6 o Attack deals 12 damage o Maxhp is 140 o Has an attribute SP, similar to ghosts o Cannot attack other ships o Can cloak, similar to ghosts  Battlecruiser o Range is 6 o Attack deals 8 damage o Maxhp is 550 o Has an attribute SP which is initially 250 o Has a function weaponRefit(Target)  Deals 300 damage to the target as long as SP is greater than or equal to 125  Decreases SP by 125  Range is 10
  • 5. Buildings  CommandCenter o Maxhp is 1500 o Has function trainSCV, which returns an SCV object  Barracks o Maxhp is 1000 o Has functions:  trainMarine, which returns a Marine object  trainMarauder, which returns a Marauder object  trainGhost, which returns a Ghost object  Factory o Maxhp is 1250 o Has functions:  trainHellion, which returns a Hellion object  trainSiegeTank, which returns a SiegeTank object  trainThor, which returns a Thor object  Starport o Maxhp is 1300 o Has functions:  trainViking, which returns a Viking object  trainMedivac, which returns a Medivac object  trainBanshee, which returns a Banshee object  trainBattlecruise, which returns a Battlecruiser object BONUS FUNCTIONS  Buildings have the ability liftoff (5 pts) o Status is set to “Flying” o While flying only units that can attack flying units can attack it  Buildings also have ability to land (5 pts) o Status is set to “Normal” o While flying only units that can attack ground units can attack it  Vikings also have the ability to lift-off and land (5 pts) o While flying, Vikings can only attack flying units o While landed, Vikings can only attack units that are not flying  Hellions deal 16 damage to Infantry units (5 pts)  If a Medivac dies, all unit inside it also dies (5 pts)  Output a message (System.out.println) whenever an attack is successful or not. (5 pts)