Exemple #1
0
 void CGME.IEngineListener.Act(CGME.EngineEvent ee, CGME.CGObject source, CGME.CGObject param1, CGME.CGObject param2)
 {
     switch (ee)
     {
     case CGME.EngineEvent.TransferChild:
         TransferObjects(param1, param2);
         break;
     }
 }
Exemple #2
0
        //void CGME.EngineListener.Act(CGME.EngineEvent ee, CGME.CGObject source, CGME.CGObject param1, CGME.CGObject param2);

        protected CGMObject AddChild(CGME.CGObject obj, string type)
        {
            GameObject child = new GameObject(obj.CGType);

            child.AddComponent(type);
            child.SendMessage("SetObject", obj);
            child.transform.parent = transform;
            //child.name = obj.Name;
            return(child.GetComponent <CGMObject>());
        }
Exemple #3
0
 protected override void RemoveChild(CGME.CGObject cgobj)
 {
     for (int i = 0; i < transform.childCount; i++)
     {
         Card child = transform.GetChild(i).GetComponent <Card>();
         if (child != null && child.CGME_Card == (cgobj as CGME.Card))
         {
             Destroy(child.gameObject);
         }
     }
 }
Exemple #4
0
        void CGME.IEngineListener.Act(CGME.EngineEvent ee, CGME.CGObject source, CGME.CGObject param1, CGME.CGObject param2)
        {
            switch (ee)
            {
            case CGME.EngineEvent.AddChild:
                break;

            case CGME.EngineEvent.AddResource:
                AddChild(param1, "Resource");
                break;
            }
        }
Exemple #5
0
        void TransferObjects(CGME.CGObject target, CGME.CGObject destination)
        {
            CGMObject cgm_target = FindObject(target);
            CGMObject cgm_dest   = FindObject(destination);

            if (cgm_target != null && cgm_dest != null)
            {
                //Debug.Log ("Transfering");
                cgm_target.gameObject.transform.parent = cgm_dest.transform;
                cgm_dest.Reposition();
            }
        }
Exemple #6
0
        void CGME.IEngineListener.Act(CGME.EngineEvent ee, CGME.CGObject source, CGME.CGObject param1, CGME.CGObject param2)
        {
            switch (ee)
            {
            case CGME.EngineEvent.SetId:
                ID = param1.Id;
                break;

            case CGME.EngineEvent.ModifyResource:
                view.Update();
                break;
            }
        }
Exemple #7
0
        CGM.CGMObject FindObject(CGME.CGObject cgme_obj)
        {
            CGM.CGMObject[] cgm_obj_array = FindObjectsOfType <CGMObject>();

            foreach (CGMObject cgm_obj in cgm_obj_array)
            {
                if (cgm_obj.ID == cgme_obj.Id)
                {
                    return(cgm_obj);
                }
            }

            return(null);
        }
Exemple #8
0
 void CGME.IActionEventListener.ActEvent(CGME.CustomActionEvent action, CGME.CGObject source, CGME.CGObject param1, CGME.CGObject param2)
 {
     switch (action)
     {
     case CGME.CustomActionEvent.FocusObject:
         if (param1 is CGME.Actor)
         {
             FocusObject(param1 as CGME.Actor);
         }
         else
         {
             Debug.Log(param1.CGType + " cannot be focused on");
         }
         break;
     }
 }
Exemple #9
0
        void CGME.IEngineListener.Act(CGME.EngineEvent ee, CGME.CGObject source, CGME.CGObject param1, CGME.CGObject param2)
        {
            switch (ee)
            {
            case CGME.EngineEvent.SetId:
                ID = param1.Id;
                break;

            case CGME.EngineEvent.AddResource:
                AddChild(param1, "Resource");
                break;

            case CGME.EngineEvent.BufferSelect:
                renderer.material.color = Color.gray;
                break;


            case CGME.EngineEvent.BufferRemove:
                renderer.material.color = Color.white;
                break;
            }
        }
Exemple #10
0
//		void Start(){
//			RegisterCards();
//			RegisterResources();
//			SetListener ();
//
//		}

        void CGME.IEngineListener.Act(CGME.EngineEvent ee, CGME.CGObject source, CGME.CGObject param1, CGME.CGObject param2)
        {
            switch (ee)
            {
            case CGME.EngineEvent.SetId:
                ID = param1.Id;
                break;

//			case CGME.EngineEvent.AddChild:
//				//AddChild (param1,"Card");
//				break;
//			case CGME.EngineEvent.TransferChild:
//				//RemoveChild (param1);
//				break;
            case CGME.EngineEvent.AddResource:
                AddChild(param1, "Resource");
                break;

            case CGME.EngineEvent.UpdateChildren:
                UpdateChildren();
                break;
            }
        }
Exemple #11
0
 public override void SetObject(CGME.CGObject cgobj)
 {
     CGME_Player = (CGME.Player)cgobj;
 }
Exemple #12
0
 public override void SetObject(CGME.CGObject cgobj)
 {
     CGME_Card = (CGME.Card)cgobj;
 }
Exemple #13
0
        //protected abstract void Register(CGMObject parent);

        //protected abstract void RegisterResources();
        public abstract void SetObject(CGME.CGObject cgobj);
Exemple #14
0
 public override void SetObject(CGME.CGObject cgobj)
 {
     CGME_Deck = (CGME.Deck)cgobj;
 }
Exemple #15
0
 public override void SetObject(CGME.CGObject cgobj)
 {
     return;
 }
Exemple #16
0
 protected virtual void RemoveChild(CGME.CGObject obj)
 {
 }
Exemple #17
0
//		public Resource(){
//			if (CGME_resource == null)CGME_resource = new CGME.ResourceNumber();
//
//			//Resource_type =
//		}

        public void SetObject(CGME.CGObject cgobj)
        {
            CGME_resource = (CGME.Resource)cgobj;
        }
Exemple #18
0
 public override void SetObject(CGME.CGObject cgobj)
 {
     CGME_Phase = (CGME.Phase)cgobj;
 }
Exemple #19
0
 public override void SetObject(CGME.CGObject cgobj)
 {
     CGME_game = (CGME.Game)cgobj;
 }
Exemple #20
0
 public override void SetObject(CGME.CGObject cgobj)
 {
     CGME_action_root = (CGME.ActionGroup)cgobj;
 }