# Copyright (C) 2024 Michael Becker  <alcexhim@gmail.com>
# 
# This file is part of mocha-python.
# 
# mocha-python is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# mocha-python is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with mocha-python.  If not, see <https://www.gnu.org/licenses/>.

from framework import Guid

class McxInstance:

	def __init__(self, class_global_identifier : Guid, instance_global_identifier : Guid, class_index : int, instance_index : int):

		self._class_global_identifier = class_global_identifier
		self._instance_global_identifier = instance_global_identifier
		self._class_index = class_index
		self._instance_index = instance_index

	def get_instance_global_identifier(self) -> Guid:
		return self._instance_global_identifier
	def get_class_global_identifier(self) -> Guid:
		return self._class_global_identifier
	
	def get_class_index(self) -> int:
		return self._class_index
	
	def get_instance_index(self) -> int:
		return self._instance_index
	
	def get_instance_key(self) -> str:
		return str(self._class_index) + '$' + str(self._instance_index)
	
	def __str__(self) -> str:
		return str(self.get_instance_global_identifier()) + " [" + str(self.get_class_index()) + "$" + str(self.get_instance_index()) + "]"