Files
2026-05-04 18:04:39 +02:00

118 lines
2.8 KiB
Plaintext

@startuml
skinparam classAttributeIconSize 0
skinparam monochrome false
skinparam shadowing false
' --- Třídy a Rozhraní ---
interface IMenuItem <<Interface>> {
+ ~IMenuItem()
+ {abstract} getPrice() : double
+ {abstract} getName() : string
+ {abstract} printInfo() : string
}
class MenuItem {
# name : string
# basePrice : double
+ MenuItem(n: string, b: double)
+ ~MenuItem()
+ getPrice() : double
+ getName() : string
+ printInfo() : string
}
class Drink {
- volume : int
- isCarbonated : bool
+ Drink(n: string, b: double, v: int, c: bool)
+ ~Drink()
+ printInfo() : string
}
class AlcoholicDrink {
- alcoholContent : double
+ AlcoholicDrink(n: string, b: double, v: int, c: bool, a: double)
+ ~AlcoholicDrink()
+ printInfo() : string
}
class Ingredient {
- name : string
- cost : double
+ Ingredient()
+ Ingredient(name: string, cost: double)
+ ~Ingredient()
+ getName() : string
+ getCost() : double
}
class Pizza {
- diameter : int
- hasExtraCheese : bool
- ingredients : Ingredient**
- maxIngredients : int
- currentIngredients : int
+ Pizza()
+ Pizza(n: string, b: double, d: int, e: bool, m: int)
+ ~Pizza()
+ addIngredient(i: Ingredient*) : bool
+ removeIngredient(name: string) : bool
+ getPrice() : double
+ printInfo() : string
+ getDiameter() : int
}
class Customer {
- name : string
- phone : string
- loyaltyPoints : int
+ Customer(n: string, p: string, l: int)
+ ~Customer()
+ addPoints(points: int) : void
+ getDetails() : string
}
class Order {
- items : IMenuItem**
- itemCount : int
- capacity : int
- {static} totalOrder : int
- customer : Customer*
+ Order(capacity: int, c: Customer*)
+ ~Order()
+ getCustomer() : Customer*
+ addItem(i: IMenuItem*) : bool
+ removeItem(name: string) : bool
+ calculateTotal() : double
+ {static} getTotaOrders() : int
+ getItemCount() : int
+ getItem(index: int) : IMenuItem*
}
class Pizzeria {
- name : string
- activeOrders : Order**
- orderCount : int
+ Pizzeria(n: string, maxOrders: int)
+ ~Pizzeria()
+ processOrder(o: Order*) : void
}
' --- Vztahy (Relationships) ---
' Dědičnost a Implementace
IMenuItem <|-- MenuItem : "dědí z"
MenuItem <|-- Drink : "dědí z"
MenuItem <|-- Pizza : "dědí z"
Drink <|-- AlcoholicDrink : "dědí z"
' Kompozice (plné kosočtverce - vlastník maže své části v destruktoru)
Pizza *-- "0..*" Ingredient : "obsahuje >"
Order *-- "0..*" IMenuItem : "obsahuje >"
' Agregace (prázdné kosočtverce - odkazuje na objekt, ale nemaže ho přímo)
Order o-- "1" Customer : "patří >"
Pizzeria o-- "0..*" Order : "spravuje >"
@enduml