コード例 #1
0
            public void TestLongerInheritance()
            {
                MyFunctionality instFunctionality = new DerivedMyFunctionality();
                IFunctionality  instInterface     = instFunctionality;

                instFunctionality.Method();
                instInterface.Method();
            }
コード例 #2
0
ファイル: Field.cs プロジェクト: MrGottham/789fe44a87d4
        public void AddFunctionality(IFunctionality functionality)
        {
            if (functionality == null)
            {
                throw new ArgumentNullException("functionality");
            }

            _functionality.Add(functionality);
        }
コード例 #3
0
        private PlayerFactory(string aFilePathToGraphic, IFunctionality aFunction, Vector2 aScreenCoordinate, Vector2 aWorldCoordinate)
        {
            //    mFilePathToGraphic = aFilePathToGraphic;
            Function = aFunction;

            ScreenPosition = aScreenCoordinate;
            WorldPosition = aWorldCoordinate;

            PlayerManager.GetManager().Add(this);
        }
コード例 #4
0
            public void TestInheritance()
            {
                MyFunctionality      instDerived   = new MyFunctionality();
                DefaultFunctionality instBase      = instDerived;
                IFunctionality       instInterface = instDerived;

                Console.WriteLine("Type is (" + instInterface.GetIdentifier() + ")");
                Console.WriteLine("Calling the interface");
                instInterface.Method();
                Console.WriteLine("Calling the derived");
                instDerived.Method();
                Console.WriteLine("Calling the base class");
                instBase.Method();
            }
コード例 #5
0
ファイル: Common.cs プロジェクト: MSkjel/Andromeda
        public static void Register(IFunctionality functionality)
        {
            if (functionality is IPerms perms)
            {
                if (Common.perms == null)
                {
                    Common.perms           = perms;
                    Exports[nameof(Perms)] = Perms;
                }
                else
                {
                    Warning("Perms already assigned", $"Ignoring new register: {perms.Version}");
                }
            }

            if (functionality is IUtils utils)
            {
                if (Common.utils == null)
                {
                    Common.utils           = utils;
                    Exports[nameof(Utils)] = Utils;

                    colorScheme = utils.ColorScheme.Export();
                }
                else
                {
                    Warning("Utils already assigned", $"Ignoring new register: {utils.Version}");
                }
            }

            if (functionality is IAdmin admin)
            {
                if (Common.admin == null)
                {
                    Common.admin           = admin;
                    Exports[nameof(Admin)] = Admin;
                }
                else
                {
                    Warning("Admin already assigned", $"Ignoring new register: {admin.Version}");
                }
            }

            functionalities.Add(functionality);
        }
コード例 #6
0
 public FunctionsController(IFunctionality service)
 {
     this.Service = service;
 }
コード例 #7
0
 public FunctionsController(IFunctionality service)
 {
     this.Service = service;
 }
コード例 #8
0
 public FunctionalityController()
 {
     Service = new FunctionalityService();
 }
コード例 #9
0
 public static void CreatePlayer(string aFilePathToGraphic, IFunctionality aFunction, Vector2 aScreenCoordinate, Vector2 aWorldCoordinate)
 {
     new PlayerFactory(aFilePathToGraphic, aFunction, aScreenCoordinate, aWorldCoordinate);
 }
コード例 #10
0
 public FunctionalityController()
 {
     Service = new FunctionalityService();
 }